1.
var value = Math.pow(0, 10);
document.write("<br />Fourth Test Value : " + value ); Type question here
Correct Answer
A. Fourth Test Value : 0
Explanation
The correct answer is "Fourth Test Value : 0". The Math.pow() function is used to calculate the power of a number. In this case, 0 raised to the power of 10 is equal to 0. Therefore, the value variable will be assigned the value of 0.
2.
var value = Math.min(100);
document.write("<br />Fourth Test Value : " + value );
Correct Answer
A. Fourth Test Value : 100
Explanation
The Math.min() function is used to find the minimum value among a set of numbers. In this case, the function is called with only one parameter, which is 100. Since there are no other numbers to compare it to, the minimum value is simply 100. Therefore, the output is "Fourth Test Value : 100".
3.
var value = Math.ceil(-45.95);
document.write("<br />Third Test Value : " + value );
Correct Answer
B. Third Test Value : -45
Explanation
The Math.ceil() function returns the smallest integer greater than or equal to a given number. In this case, the given number is -45.95. Since -45 is the smallest integer greater than or equal to -45.95, the value returned by Math.ceil(-45.95) is -45. Therefore, the correct answer is "Third Test Value : -45".
4.
<html>
<head>
<title>JavaScript String indexOf() Method</title>
</head>
<body>
<script type="text/javascript">
var str1 = new String( "This is string one" );
var index = str1.indexOf( "string" );
document.write("indexOf found String :" + index );
Correct Answer
B. IndexOf found String :8
Explanation
The correct answer is 8 because the indexOf() method in JavaScript returns the index of the first occurrence of a specified string within another string. In this case, the string "string" is found at index 8 in the string "This is string one".
5.
<html>
<head>
<title>JavaScript String charCodeAt() Method</title>
</head>
<body>
<script type="text/javascript">
var str = new String( "This is string" );
document.write("str.charCodeAt(0) is:" + str.charCodeAt(0));
document.write("<br />str.charCodeAt(1) is:" + str.charCodeAt(1));
</script>
</body>
</html>
Correct Answer(s)
A. Str.charCodeAt(0) is:84
C. Str.charCodeAt(0) is:104
Explanation
The charCodeAt() method is used to return the Unicode value of the character at a specified index in a string. In this code snippet, the variable "str" is a string that says "This is string". The charCodeAt(0) method is used to get the Unicode value of the character at index 0, which is "T". The Unicode value of "T" is 84. Similarly, the charCodeAt(1) method is used to get the Unicode value of the character at index 1, which is "h". The Unicode value of "h" is 104.
6.
<html>
<head>
<title>JavaScript String charAt() Method</title>
</head>
<body>
<script type="text/javascript">
var str = new String( "This is string" );
document.writeln("str.charAt(0) is:" + str.charAt(0));
document.writeln("<br />str.charAt(1) is:" + str.charAt(1));
Correct Answer(s)
A. Str.charAt(0) is:T
C. Str.charAt(1) is:h
Explanation
The charAt() method is used to return the character at a specified index in a string. In this code snippet, the variable "str" is a string "This is string". The charAt(0) method is called on the string "str", which returns the character at index 0, which is "T". Similarly, the charAt(1) method is called on the string "str", which returns the character at index 1, which is "h". Therefore, the correct answer is "str.charAt(0) is:T ,str.charAt(1) is:h".
7.
<script>
eval("x=10;y=20;
document.write(x*y)");
Correct Answer
A. 200
Explanation
The given script uses the eval() function to evaluate the JavaScript code as a string. It assigns the values 10 to x and 20 to y, and then calculates the product of x and y using the document.write() function. Therefore, the output of the script is 200.
8.
<script>
document.write("<br>" + eval("2+2"));
Correct Answer
B. 4
Explanation
The given code snippet is using the eval() function to evaluate the expression "2+2" and then printing the result using the document.write() method. The expression "2+2" evaluates to 4, so the output of the code will be 4. Therefore, the correct answer is 4.
9.
<script>
var x=10;
document.write("<br>" + eval(x+17));
Correct Answer
D. None of abve
Explanation
The code snippet initializes a variable x with the value 10. It then uses the eval() function to evaluate the expression x+17, which results in 27. The document.write() method is used to display the result on the webpage. Therefore, the correct answer is 27, not any of the given options.
10.
<script type="text/javascript">
var username = "someAgent";
if(username == "SomeAgent")
document.write("Welcome special agent");
else
document.write("Access Denied!");
Correct Answer
C. Access Denied!
Explanation
The correct answer is "Access Denied!" because the value of the variable "username" is "someAgent" which does not match the condition "SomeAgent". Therefore, the else statement is executed and the message "Access Denied!" is displayed.
11.
<script type="text/javascript">
var username = "someAgent";
if(username == "SomeAgent")
document.write("Welcome special agent");
else
document.write("Access Denied!");
for getting output"Welcome special agent" can we use .toUpperCase () or .toLowerCase () ??
Correct Answer
A. True
Explanation
The correct answer is true because the .toUpperCase() or .toLowerCase() methods can be used to convert the value of the variable "username" to either all uppercase or all lowercase letters. Since the comparison in the if statement is checking for an exact match with "SomeAgent", using either of these methods would result in a match and the output "Welcome special agent" would be displayed.
12.
<script type="text/javascript">
var aURL = "http://www.tizag.com/www.html";
var aPosition = aURL.indexOf("www");
document.write("The position of www = " + aPosition);
Correct Answer
A. The position of www = 7
Explanation
The correct answer is "The position of www = 7" because the indexOf() method in JavaScript returns the position of the first occurrence of the specified value within a string. In this case, the value "www" is found at index 7 in the string "http://www.tizag.com/www.html".
13.
<script type="text/javascript">
var visitorName = "Chuck";
var myOldString = "Hello username! I hope you enjoy your stay username.";
var myNewString = myOldString.replace(/username/g, visitorName);
document.write("<br />New string = " + myNewString);
Correct Answer
New string = Hello Chuck! I hope you enjoy your stay Chuck.
Hello Chuck! I hope you enjoy your stay Chuck.
Explanation
The given code snippet uses the `replace()` function in JavaScript to replace all occurrences of the word "username" in the `myOldString` variable with the value of the `visitorName` variable, which is "Chuck". The `/username/g` is a regular expression pattern that matches all occurrences of "username" in the string. The resulting new string, stored in the `myNewString` variable, is then displayed using the `document.write()` function. The answer shows the new string after the replacement has been made, which is "Hello Chuck! I hope you enjoy your stay Chuck." repeated twice.
14.
<script type="text/javascript">
var myRegExp = /Alex|John/;
var string1 = "Today John went to the store and talked with Alex.";
var matchPos1 = string1.search(myRegExp);
if(matchPos1 != -1)
document.write("There was a match at position " + matchPos1);
else
document.write("There was no match in the first string");
Correct Answer
B. There was a match at position 6
Explanation
The regular expression /Alex|John/ is used to search for either "Alex" or "John" in the given string. In this case, the string "Today John went to the store and talked with Alex." is searched. The matchPos1 variable stores the position of the first occurrence of a match. Since "John" is found at position 6 in the string, the condition matchPos1 != -1 is true and the message "There was a match at position 6" is displayed.
15.
Following are the example of E-governance
Correct Answer(s)
A. C2G
C. B2G
Explanation
The correct answer is C2G and B2G. C2G refers to Citizen-to-Government e-governance, which involves the interaction between citizens and government agencies through digital platforms. B2G stands for Business-to-Government e-governance, which involves the exchange of information and services between businesses and government entities. Both C2G and B2G are examples of e-governance models that aim to improve efficiency, transparency, and accessibility in government operations.
16.
Www.olx.in is example of
Correct Answer
C. C2C
Explanation
www.olx.in is an example of C2C, which stands for consumer-to-consumer. This means that the website facilitates transactions between individual consumers, allowing them to buy and sell products directly to each other. OLX is a classifieds platform where individuals can post advertisements for items they want to sell, and other individuals can contact them to make a purchase. This platform does not involve any businesses or intermediaries, making it a clear example of C2C.
17.
In Traditional commerce consumer can get world level choice of product ?
Correct Answer
B. False
Explanation
In traditional commerce, consumers do not have access to a world level choice of products. Traditional commerce typically involves physical stores and limited product offerings within a specific geographic location. Consumers are limited to the products available in their local area and may not have access to a wide range of options from different parts of the world. With the advent of e-commerce and online shopping, consumers now have the ability to access a global marketplace and choose from a much wider range of products.
18.
In which firewall setting needs maximum as well as more server required
Correct Answer
Extranet
EXTRANET
extranet
Explanation
The correct answer is "Extranet". An extranet is a private network that allows external users, such as customers, suppliers, or partners, to access specific resources or services of an organization. Setting up a firewall for an extranet requires more server resources because it involves managing and securing connections from both internal and external networks. The firewall needs to be configured to allow authorized external users to access the necessary resources while protecting the internal network from unauthorized access. Therefore, an extranet requires maximum firewall settings and more servers to ensure secure and controlled access for external users.
19.
In market hierarchy model what are the major risk
Correct Answer(s)
B. Transportation cost
D. Raw material & suppliers
E. High investment behind an industry
Explanation
The major risks in the market hierarchy model include transportation costs, raw material and supplier risks, and high investment behind an industry. Transportation costs can impact the profitability of a business by increasing expenses. Raw material and supplier risks refer to the potential disruptions in the supply chain, such as shortages or quality issues. High investment behind an industry means that there is a significant amount of capital required to enter and operate in that industry, which poses a risk if the return on investment is not achieved.
20.
EDI stands for
Correct Answer
A. Electronic Date Interchange
Explanation
EDI stands for Electronic Data Interchange. It is a system that allows the exchange of business documents electronically between different organizations. It enables the transfer of data in a standardized format, eliminating the need for manual data entry and reducing errors. This technology has been widely adopted in various industries, such as supply chain management and finance, to streamline business processes and improve efficiency.
21.
Check the example of Database EDI in E-commerce
Correct Answer(s)
A. User login
C. Produce out of order
E. Our shipping address
Explanation
The given correct answer includes the phrases "user login," "Produce out of order," and "Our shipping address." These phrases are likely examples of different functionalities or processes related to the use of a database in an e-commerce system. The first phrase suggests a step where a user logs into the system, possibly to access their account or perform certain actions. The second phrase implies a situation where a product is produced or processed in an incorrect order, which could be a potential issue in the system. The third phrase indicates the need for a shipping address, which is likely required for delivering products to customers.
22.
Select the product which is suitable for Traditional Business form
Correct Answer(s)
A. Vegitable
D. Gold
E. Petrol
Explanation
The products that are suitable for a traditional business form are typically ones that have been traditionally bought and sold, such as vegetables, gold, and petrol. These products have been a part of traditional business transactions for a long time and are commonly traded in traditional marketplaces. Additionally, they have a high demand and are considered essential commodities in many industries. On the other hand, products like belts, branded shoes, and branded cameras may be more associated with modern consumer preferences and may not be as commonly traded in traditional business settings.