subject

Write a program that grades arithmetic quizzes as follows:

1. ask the user how many questions are in the quiz.
2. ask the user to enter the key (that is, the correct answers).there should be one answer for each question in the quiz, and eachanswer should be an integer. they can be entered on a single line, e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a10-question quiz. you will need to store the key in an array.
3. ask the user to enter the answers for the quiz to be graded. asfor the key, these can be entered on a single line. again thereneeds to be one for each question. note that these answers do notneed to be stored; each answer can simply be compared to the key asit is entered.
4. when the user has entered all of the answers to be graded, printthe number correct and the percent correct.

when this works, add a loop so that the user can grade anynumber of quizzes with a single key. after the results have beenprinted for each quiz, ask "grade another quiz? (y/n)."


i am not sure what do due for the last part, adding a loop so theuser can grade any number of quizzes with a single key and afterthe results have been printed for each quiz, ask
this is what i have so far, i think i got 1-4 done, last parti am stuck

public class quiz
{
public static void main(string[] args)
{
int num_quiz; //number on thequiz
int to_grade;
int count = 0;
double total;
int total_quizzes; //total #of quizzes to be graded
scanner scan = new scanner(system. in);
system. out. print ("how many questions are in the quiz? ");
num_quiz =scan. nextint();
int [] answers = new int[num_quiz];
system. out. println("enter theanswer keys for the questions.");
for (int i=0; i {
answers[i] =scan. nextint();
}

system. out. print("how many quizzes do you wantto grade? ");
total_quizzes =scan. nextint();
for (int i =0; i {
system. out. println("enter the answer to be graded : ");
to_grade = scan. nextint();
if(to_grade == answers[i]){
++count;
}
}
total = (double)count /num_quiz *100;
system. out. println("thenumber of questions correct are: " + count);
system. out. println("thepercentage correct is: " +total);
system. out. println("gradeanother quiz? y/n");
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:40
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
You know the right answer?
Write a program that grades arithmetic quizzes as follows:

1. ask the user how many que...
Questions
question
Mathematics, 09.07.2021 01:30
question
English, 09.07.2021 01:30
question
Mathematics, 09.07.2021 01:30
Questions on the website: 13722361