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
What type of slab and beam used in construction of space neddle​
Dmitry [639]

Answer:

Pyramidal Space Frame Glamorizes Swimming Pool 15. News Briefs 16 ... to use every pound of steel with no sacrifice in safety or ... form of steel trusses in an inverted coni- ... be embedded in the concrete slab when.

Explanation:

I HOPE THIS HELPS

6 0
3 years ago
Differentiate between goods<br>and equipmentwhat is code ​
Natalija [7]

Answer:

KO

Explanation:

4 0
3 years ago
ALP to find cube of N 8-bit numbers in an array using 8086
coldgirl [10]

Answer:

200 MOV Si, 500

201 MOV CL [Si]

202 MOV CH,00

203 INC SI

204 MOV AL,[SI]

205 A MOV BL, AL

205 C MUL AL

205 E MUL BL

206 MOV [SI], AL

207 INC SI

208 LOOP 104

209 HLT

The above ALP program is the required one.

Explanation:

Step1: SI value = 500

Step 2:SI offset data is loaded to the CL register

Step 3: SI value = SI value + 1

Step 4: The register value is moved from AL to BL

AL happens to be an 8-bit register

Step 5: The AL value is multiplied by itself

Step 6: The value of the AL is now multiplied by BL

Step 7: The new value of the AL is stored at the SI.

Step 8: The value of the SI is incremented by 1..

LOOP 104: The program is now transferred to the 104 in case the CX=CX -1 and CX is not 0.

HLT: stop  

8 0
3 years ago
Which method can help you prevent RSI while using a keyboard?
larisa [96]
Rest the right-hand’s fingers on Q,W, E, and R keys.is the correct answer
3 0
3 years ago
In MS Excel, a function is written as =FUNCTION_NAME(_____________________).​
otez555 [7]

Explanation:

A function is a predefined formula that performs calculations using specific values in a particular order. All spreadsheet programs include common functions that can be used for quickly finding the sum, average, count, maximum value, and minimum value for a range of cells. In order to use functions correctly, you'll need to understand the different parts of a function and how to create arguments to calculate values and cell references.

6 0
3 years ago
Other questions:
  • While investigating the settings on your SOHO router, you find two IP addresses reported on the device’s routing table, which is
    15·1 answer
  • All of the following are interpreted languages
    8·1 answer
  • What is a bug?
    11·2 answers
  • Based on the passage​ and/or drawing on your prior​ knowledge, you realize that an HMO is​ what?
    9·1 answer
  • The audience for your security assessment report (SAR) is the leadership of your company, which is made up of technical and nont
    6·1 answer
  • What was original name<br> whoever answers first gets brainly crown
    9·1 answer
  • Does anybody know the answer to 5.7.5: Factorial of Code HS? I can’t figure it out
    14·2 answers
  • What type of file format is PSD?
    11·2 answers
  • (40 PTS) Be specific
    12·1 answer
  • What report shows which types of mobile devices visited a website?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!