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 12:20
Usually, when we sniff packets, we are only interested certain types of packets. we can do that by setting filters in sniffing. scapyโ€™s filter use the bpf (berkeley packet filter) syntax; you can find the bpf manual from the internet. set the following filters and demonstrate your sniffer program again (each filter should be set separately): (a) capture only the icmp packet. (b) capture any tcp packet that comes from a particular ip and with a destination port number 23. (c) capture packets comes from or to go to a particular subnet. you can pick any subnet, such as 128.230.0.0/16; you should not pick the subnet that your vm is attached to.
Answers: 3
question
Computers and Technology, 22.06.2019 15:30
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print โ€œbad input.โ€ and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
Write a program that grades arithmetic quizzes as follows:

1. ask the user how many que...
Questions
Questions on the website: 13722363