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
sdas [7]
3 years ago
10

1. Write a program that grades arithmetic quizzes as follows: (4 points) a. Assume there are 23 questions in the quiz. b. Ask th

e user to enter the key (i.e., the correct answers). There should be one answer for each question, and each answer should be an integer. The numbers are entered on a single line, e.g., 34 7 13 100 81 3 9 10 321 12 34 7 13 100 81 3 9 10 321 12 9 10 321. c. Ask the user to enter the answers for the quiz to be graded. Store the answers in an array. d. Print the number correct and the percent correct. e. Put the whole program in a do-while loop.
Computers and Technology
1 answer:
const2013 [10]3 years ago
5 0

Answer:

import java.util.Scanner;

public class Grade

{

public static void main(String[] args) {

   

    final int LENGTH = 23;

    int keys[] = new int[LENGTH];

    int responses[] = new int[LENGTH];

    int i = 1, correctCount = 0;

   

    Scanner input = new Scanner(System.in);

    do {

       

        System.out.print("Enter the key for answer " + i + ": ");  

        int key = input.nextInt();    

        keys[i-1] = key;

       

        System.out.print("Enter your response to question " + i + ": ");  

        int response = input.nextInt();    

        responses[i-1] = response;

       

        if (keys[i-1] == responses[i-1]) {

            correctCount ++;  

        }

        i++;

    }

   

    while(i <= LENGTH);

   

    double percentage = (double)correctCount / LENGTH;

   

 System.out.println("Number of the correct answers: " + correctCount);

 System.out.println("Percentage of the correct answers: " + percentage);

}

}

Explanation:

- Initialize the variables

Inside the do-while loop :

- Ask for the answer key and put the values in keys array

- Ask for the responses and put the values in responses array

- If values at the same position in both arrays are equal, increase the correctCount, that means the response is correct

- Print the correcCount and percentage

You might be interested in
How do I add a Child to my Brainly account
ratelena [41]

Answer:

i think you might have to just make adjfferent one for thenm a sepeet account. but im not sure atleast ive never seen anywere if you can add someo e else to the same account.

5 0
1 year ago
Case 2-2 Jack has a computer at home that he uses to access the Internet, store and edit personal photos, and create and edit do
bekas [8.4K]

Answer:

Check button under error checking

Explanation:

Under the Tools tab there are two options:

Error checking and Optimize and defragment drive option.

clicking the check button with administrative permission under error checking option will examine the hard drive for errors.

3 0
3 years ago
A microsoft windows os component responsible for representing graphical objects and transmitting them to output devices such as
vaieri [72.5K]
A driver. A driver is basicly and application or component that helps communicate between you computer and a device(a mouse, keyboard, printer etc.) You may have know when you get a new mouse and connect it up, Windows always tries to find a driver and download it. 
5 0
3 years ago
Q) CITY column of a table contains information such as Bangalore , Bangalore-64 , Bangalore-56001 , Mumbai - 400002 etc in order
saw5 [17]
Data splitting:::::::::::)
7 0
3 years ago
What does this sign mean?
yKpoI14uk [10]
A. yield to the car on your right
8 0
3 years ago
Read 2 more answers
Other questions:
  • Is anyone familiar in drawing flow charts for c++ programming
    14·1 answer
  • What type of engineer works on cleaning up oil spills?
    8·2 answers
  • You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
    8·1 answer
  • I want pizzzzzzzaaaaaaaaaaa
    9·1 answer
  • A blue NFiPA label indicates: A) Health Hazard B) Special information C) Flammability D) Reactivity
    6·2 answers
  • Match the elements used in web searches to their functions.
    12·1 answer
  • 3. The following is a dump of a UDP header in hexadecimal format. 0045DF000058FE20 a. What is the source port number? b. What is
    15·1 answer
  • Accenture has put together a coalition of several ecosystem partners to implement the principles of blockchain and Multi-party S
    5·1 answer
  • Im a beginner programmer. what languages should i learn and how do i get better
    13·1 answer
  • What is the official name of an application on a desktop or a laptop?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!