Question

In: Computer Science

java script coding to create a math test program with 5 questions.

java script coding to create a math test program with 5 questions.

Solutions

Expert Solution

JavaScript program to create a math test

  • Declare variables in array
  • Define function
  • Call and execute the function

The source code:

var myQuestions = [
        {
                question: "What is 2*20?",
                answers: {
                        a: '30',
                        b: '40',
                        c: '50'
                }
                correctAnswer: 'b'
        }
        {
                question: "What is 30/3?",
                answers: {
                        a: '3',
                        b: '5',
                        c: '10'
                }
                correctAnswer: 'c'
        }
{
                question: "What is 199+3?",
                answers: {
                        a: '201',
                        b: '210',
                        c: '202'
                }
                correctAnswer: 'c'
        }
{
                question: "What is 30-3?",
                answers: {
                        a: '27',
                        b: '52',
                        c: '10'
                }
                correctAnswer: 'a'
        }
{
                question: "What is 30% of300?",
                answers: {
                        a: '30',
                        b: '90',
                        c: '100'
                }
                correctAnswer: 'b'
        }
];
console.log(myQuestions);

Related Solutions

Create an application that asks a user to answer 5 math questions. JAVA
Create an application that asks a user to answer 5 math questions. JAVA
5) Create the following in a Java program Create a scanner Prompt the user to enter...
5) Create the following in a Java program Create a scanner Prompt the user to enter the name where the box of mail is shipping from and create the variable and relate to scanner Prompt the user to enter the name of destination where the box of mail will be shipped and create the variable and relate to scanner Prompt the user to enter the weight of the package and create variable to relate to scanner Calculate cost of shipping...
create a program that asks user math questions and keeps track of answers... Python Allow the...
create a program that asks user math questions and keeps track of answers... Python Allow the user to decide whether or not to keep playing after each math challenge. Ensure the user’s answer to each math problem is greater than or equal to zero. Keep track of how many math problems have been asked and how many have been answered correctly. When finished, inform the user how they did by displaying the total number of math problems, the number they...
Create a Class with Data Fields and Methods in Java. Provide a Java coding solution for...
Create a Class with Data Fields and Methods in Java. Provide a Java coding solution for the following: 1. Name the class SalonServices 2. Add private data fields: a. salonServiceDescription – This field is a String type b. price - This field is a double type 3. Create two methods that will set the field values. a. The first method setSalonServiceDescription() accepts a String parameter defined as service and assigns it to the salonServiceDescription. The method is not static b....
Java Coding Background You will create a Java class that simulates a water holding tank. The...
Java Coding Background You will create a Java class that simulates a water holding tank. The holding tank can hold volumes of water (measured in gallons) that range from 0 (empty) up to a maximum. If more than the maximum capacity is added to the holding tank, an overflow valve causes the excess to be dumped into the sewer system. Assignment The class will be named HoldingTank. The class attributes will consist of two int fields – current and maxCapacity....
Part C (25 pts) Coding question Create a Java class name Store_XXXXX with last 5 digits...
Part C (25 pts) Coding question Create a Java class name Store_XXXXX with last 5 digits of your student ID and write your code in there. A PC store sells many types of computers. The PC can have either 16 or 8 gigabytes of memory. The quality of the PCs can be either New, Refurbished, or Dented. The price list is given as follows: Memory size/Status New Refurbished Dented 16 gigabytes 849.99 729.99 609.99 8 gigabytes 699.99 579.99 439.99 Determine...
Need a program in java that creates a random addition math quiz The program should ask...
Need a program in java that creates a random addition math quiz The program should ask the user to enter the following The smallest and largest positive numbers to be used when generating the questions - The total number of questions to be generated per quiz - The total number of the quiz's to create from then the program should generate a random math (Just addition) quiz from what the user entered
Create a Python script in IDLE or Kali Python3 CLI to create the following Python Program:...
Create a Python script in IDLE or Kali Python3 CLI to create the following Python Program: Your program will create a username of your choice using a Kali Linux command "useradd -m mark", then set the password for that user using the Kali Linux Command "echo "mark:10101111" | chpasswd". Then you create a dictionary file using the Kali Linux command "crunch 8 8 01 > mylist.txt" Your python script should crack the password for that user and display on the...
For this coding exercise, you need to create a new Java project in Eclipse and finish...
For this coding exercise, you need to create a new Java project in Eclipse and finish all the coding in Eclipse. Run and debug your Eclipse project to make sure it works. Then you can just copy and paste the java source code of each file from Eclipse into the answer area of the corresponding box below. The boxes will expand once you paste your code into them, so don’t worry about how it looks J All data members are...
Java Questions involving OOP: (Include java coding examples if possible) (1) What is an exception type...
Java Questions involving OOP: (Include java coding examples if possible) (1) What is an exception type an instance of? (2) What are the conditions when a class implements an interface? (3) What is/are the conditions of creating an abstract class object from its derived concrete class?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT