JavaScript Practical & Ecommerce Quiz By Prof. Abhijeetsinh Jadeja

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Abhijeetjadeja
A
Abhijeetjadeja
Community Contributor
Quizzes Created: 2 | Total Attempts: 1,447
Questions: 25 | Attempts: 378

SettingsSettingsSettings
JavaScript Quizzes & Trivia

It is exploring about some practical concept of javascript and some of the topic of E-commerce. . . . Best of luck by Prof. Abhijeetsinh Jadeja ( KSV university , Gandhinagar , Gujarat )


Questions and Answers
  • 1. 

    var value = Math.pow(0, 10); document.write("<br />Fourth Test Value : " + value ); Type question here

    • A.

      Fourth Test Value : 0

    • B.

      Fourth Test Value : 1

    • C.

      Fourth Test Value : 10

    • D.

      None of above

    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.

    Rate this question:

  • 2. 

    var value = Math.min(100); document.write("<br />Fourth Test Value : " + value ); 

    • A.

      Fourth Test Value : 100

    • B.

      Fourth Test Value : 1

    • C.

      Fourth Test Value : 0

    • D.

      None of above

    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".

    Rate this question:

  • 3. 

    var value = Math.ceil(-45.95); document.write("<br />Third Test Value : " + value );

    • A.

      Third Test Value : -46

    • B.

      Third Test Value : -45

    • C.

      Third Test Value : -44

    • D.

      None of above

    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".

    Rate this question:

  • 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 );

    • A.

      IndexOf found String :15

    • B.

      IndexOf found String :8

    • C.

      IndexOf found String :11

    • D.

      None of above

    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".

    Rate this question:

  • 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>

    • A.

      Str.charCodeAt(0) is:84

    • B.

      Str.charCodeAt(0) is: 91

    • C.

      Str.charCodeAt(0) is:104

    • D.

      Str.charCodeAt(0) is:110

    • E.

      Str.charCodeAt(0) is:93

    • F.

      Str.charCodeAt(0) is:90

    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.

    Rate this question:

  • 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));

    • A.

      Str.charAt(0) is:T

    • B.

      Str.charAt(0) is:i

    • C.

      Str.charAt(1) is:h

    • D.

      Str.charAt(1) is:s

    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".

    Rate this question:

  • 7. 

    <script> eval("x=10;y=20; document.write(x*y)");

    • A.

      200

    • B.

      20

    • C.

      10

    • D.

      None of above

    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.

    Rate this question:

  • 8. 

    <script> document.write("<br>" + eval("2+2"));

    • A.

      2

    • B.

      4

    • C.

      2+2

    • D.

      None of above

    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.

    Rate this question:

  • 9. 

    <script> var x=10; document.write("<br>" + eval(x+17));

    • A.

      17

    • B.

      X+17

    • C.

      27

    • D.

      None of abve

    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.

    Rate this question:

  • 10. 

    <script type="text/javascript"> var username = "someAgent"; if(username == "SomeAgent")                document.write("Welcome special agent"); else        document.write("Access Denied!");               

    • A.

      Error

    • B.

      Welcome special agent

    • C.

      Access Denied!

    • D.

      None of above

    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.

    Rate this question:

  • 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 () ??

    • A.

      True

    • B.

      False

    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.

    Rate this question:

  • 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);

    • A.

      The position of www = 7

    • B.

      The position of www = 8

    • C.

      The position of www = 6

    • D.

      None of above

    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".

    Rate this question:

  • 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.

    Rate this question:

  • 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");

    • A.

      There was no match in the first string

    • B.

      There was a match at position 6

    • C.

      There was a match at position 7

    • D.

      None of above

    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.

    Rate this question:

  • 15. 

    Following are the example of E-governance

    • A.

      C2G

    • B.

      B2B

    • C.

      B2G

    • D.

      C2C

    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.

    Rate this question:

  • 16. 

    Www.olx.in is example of 

    • A.

      B2G

    • B.

      B2B

    • C.

      C2C

    • D.

      B2C

    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.

    Rate this question:

  • 17. 

    In Traditional commerce consumer can get world level choice of product ?

    • A.

      True

    • B.

      False

    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.

    Rate this question:

  • 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.

    Rate this question:

  • 19. 

    In market hierarchy model what are the major risk 

    • A.

      Intermediators

    • B.

      Transportation cost

    • C.

      Custoers

    • D.

      Raw material & suppliers

    • E.

      High investment behind an industry

    • F.

      Shop

    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.

    Rate this question:

  • 20. 

    EDI stands for 

    • A.

      Electronic Date Interchange

    • B.

      Electronic Disk Inetraction

    • C.

      Electronic Date Interaction

    • D.

      Electronic Damage Interuapption

    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.

    Rate this question:

  • 21. 

    Check the example of Database EDI in E-commerce

    • A.

      User login

    • B.

      Receive E-mail

    • C.

      Produce out of order

    • D.

      Debit card number

    • E.

      Our shipping address

    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.

    Rate this question:

  • 22. 

    Select the product which is suitable for Traditional Business form

    • A.

      Vegitable

    • B.

      Belt

    • C.

      Branded shoes

    • D.

      Gold

    • E.

      Petrol

    • F.

      Branded camera

    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.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jul 28, 2013
    Quiz Created by
    Abhijeetjadeja
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.