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, 21.06.2019 22:20
This problem has been solved! see the answeran evil king has a cellar containing n bottles of expensive wine, and his guards have just caught a spy trying to poison the king’s wine. fortunately, the guards caught the spy after he succeeded in poisoning only one bottle. unfortunately, they don’t know which one. to make matters worse, the poison the spy used was very deadly; just one drop diluted even a billion to one will still kill someone. even so, the poison works slowly; it takes a full month for the person to die. design a scheme that allows the evil king to determine exactly which one of his wine bottles was poisoned in just one month’s time while expending at most o(logn) of his taste testers.you are not allowed to use n testers, one for each bottle, and see which one tester dies after 30 days.(no pseudocode needed. just answer in words, how many testers you use, how you use them and why you correctly identify the poisoned bottle in 30 days)
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e nĂŁo consigo tira-la no chorme
Answers: 2
You know the right answer?
Write a program that grades arithmetic quizzes as follows:

1. ask the user how many que...
Questions
question
Mathematics, 18.10.2020 01:01
question
Spanish, 18.10.2020 01:01
question
Mathematics, 18.10.2020 01:01
question
History, 18.10.2020 01:01
question
Mathematics, 18.10.2020 01:01