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 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
What are some settings you can control when formatting columns?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
1. which of these is not true about torsion bars? a. they can be used to adjust ride height b. they can be adjusted anytime since they don't affect alignment angles c. they attach between the frame and the lower control arm d. they twist to produce a spring effect
Answers: 1
question
Computers and Technology, 24.06.2019 20:30
Does the query hawaiian photographers fully meets results?
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, 29.01.2021 09:20
question
Health, 29.01.2021 09:20
question
Mathematics, 29.01.2021 09:20
question
Advanced Placement (AP), 29.01.2021 09:20
question
Mathematics, 29.01.2021 09:20
Questions on the website: 13722363