1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
natka813 [3]
2 years ago
6

Capstone Project part 11 quiz

Computers and Technology
1 answer:
kobusy [5.1K]2 years ago
4 0
It is checking if the response is not yet yes
You might be interested in
For this project you will write a Java program that will run a simple math quiz. Your program will generate two random integers
ElenaW [278]

Answer:

Here is the JAVA program:

import java.util.Scanner;   //to accept input from user

public class FunWithBranching {   //class name

   public static void main(String[] args) {  //start of main function

   Scanner input = new Scanner(System.in);  //creates Scanner object

   System.out.print("Enter your name: "); //prompts user to enter name

   String userName = input.nextLine();  //stores the name

   System.out.print("Welcome " + userName + "! Please answer the following questions:\n");   //prompts user to answer the questions

   int randomOperand1 =  (int)(20 * Math.random()) + 1;  //generates random number for operand 1 (1-20)

   int randomOperand2 =  (int)(20 * Math.random()) + 1;  //generates random number for operand 2 (1-20)

   int randomAdd = randomOperand1 + randomOperand2;  //performs addition of two random numbers and stores result in randomAdd

   int randomMul = randomOperand1 * randomOperand2;  //performs multiplication of two random numbers

   int randomDiv = randomOperand1 / randomOperand2;  //performs division of two random numbers

   int randomMod = randomOperand1 % randomOperand2;  //performs modulo of two random numbers

   int correctAns = 0;  //stores number of correct answers

   System.out.print(randomOperand1 + " + " + randomOperand2 + " = ");  //displays random number + random number

   int AdditionGuess = input.nextInt();   //reads the answer of addition from user and stores it in AdditionGuess

   if (AdditionGuess == randomOperand1 + randomOperand2) {  //if the user answer is correct

   System.out.println("Correct!");  //displays correct

   correctAns++;  //adds 1 to the count of correctAns every time the user gives correct answer of addition

 } else {  //if user answer is incorrect

   System.out.println("Wrong!");  //displays wrong

   System.out.println("The correct answer is " + randomAdd);   }  //displays the correct answer of addition

   System.out.print(randomOperand1 + " * " + randomOperand2 + " = ");  //displays random number * random number  

   int MultiplicationGuess = input.nextInt();   //reads the answer of multiplication from user and stores it in MultiplicationGuess

 if (MultiplicationGuess == randomOperand1 * randomOperand2) {  //if the user answer is correct

     System.out.println("Correct!");  //displays correct

     correctAns++;  //adds 1 to the count of correctAns every time the user gives correct answer of multiplication

 }else{  //if user answer is incorrect

       System.out.println("Wrong!");  //displays wrong

       System.out.println("The correct answer is " + randomMul);   }  //displays the correct answer of multiplication

   System.out.print(randomOperand1 + " / " + randomOperand2 + " = ");  //displays random number / random number  

   int DivisionGuess = input.nextInt();   //reads the answer of division from user and stores it in DivisionGuess

   if (DivisionGuess == randomOperand1 / randomOperand2) {  //if the user answer is correct

       System.out.println("Correct!");  //displays correct

       correctAns++;   //adds 1 to the count of correctAns every time the user gives correct answer of division

       }else{  //if user answer is incorrect

           System.out.println("Wrong!");  //displays wrong

           System.out.println("The correct answer is " + randomDiv);     }  //displays the correct answer of division

      System.out.print(randomOperand1 + " % " + randomOperand2 + " = ");  //displays random number % random number  

       int ModGuess = input.nextInt();  //reads the answer of modulo from user and stores it in ModGuess

           if (ModGuess == randomOperand1 % randomOperand2) {  //if the user answer is correct

           System.out.println("Correct!");  //displays correct

           correctAns++;   //adds 1 to the count of correctAns every time the user gives correct answer of modulo

           }else{  //if user answer is incorrect

               System.out.println("Wrong!");  //displays wrong

               System.out.println("The correct answer is " + randomMod);    }  //displays the correct answer of modulo

double percentage = correctAns * 25;   //computes percentage

System.out.println("You got " + correctAns + " correct answers.");   //display number of correct answers given by user

System.out.println("That's " + percentage + "%!");         }  } //displays percentage

Explanation:

The program is well explained in the comments mentioned with each line of code. The screenshot of the output is attached.

3 0
3 years ago
A ____ is any key that uniquely identifies each row.
Mrac [35]
<span>A _superkey___ is any key that uniquely identifies each row.</span>
6 0
3 years ago
The ___ are documents which uses http ?
givi [52]
The HTML is the answer
5 0
2 years ago
What are the four components of the Universal Systems Model?
kakasveta [241]

Answer:

output, process, input, and feedback

Explanation:

5 0
3 years ago
A circular copper disk of diameter D=10 cm rotates at frequency =1800 rev/min about an axis through its center and at right angl
MAXImum [283]

Answer:

Induced current is 0.226 A

Explanation:

To calculate potential difference we have

E =1/2Bomega*r2 =1/2*1*1800*3.14*0.05=141.3

putting values we get

the p.d is 141.3

7 0
3 years ago
Other questions:
  • If the current through a heater coil is 5 amp and the supply voltage is 120 volts, the coil resistance is A. 0.04 ohm. B. 24 ohm
    6·1 answer
  • If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following
    8·1 answer
  • Jeremy’s office is in an earthquake prone area. His web server is in his office. What step should he take to protect the data on
    5·1 answer
  • a one-two paragraph summary on the Running Queries and Reports tutorials. Apply critical thinking and an academic writing style
    6·1 answer
  • Help me out here pleaseeeee
    9·2 answers
  • When evaluating mining results, data mining and evaluating becomes
    6·1 answer
  • What is the FTC used car rule
    12·1 answer
  • Computers help eliminate the repetitiveness of manual tasks. How can this benefit you in your overall career?
    9·2 answers
  • 100 points for this and brainlyist lol
    11·1 answer
  • You need to know more than just facts in order to use critical thinking skills.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!