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 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
What can you prevent issues related to downloading content form the internet
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Jean has kept the content of her website limited to what is important; she has also ensured that the text follows a particular style and color all throughout her website. which website features has jean kept in mind? jean has limited the content of her website to what is important; this ensures (clarity, simplicity, harmony and unity) of the content. she has also formatted the text in a particular style and color throughout her website, ensuring (balance, simplicity, consistency)
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
Computers and Technology, 03.06.2020 23:58
question
Mathematics, 03.06.2020 23:59
question
Mathematics, 03.06.2020 23:59
Questions on the website: 13722363