1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Maslowich
3 years ago
12

Write a program that grades arithmetic quizzes as follows: Ask the user how many questions are in the quiz. Ask the user to ente

r the key (that is, the correct answers). There should be one answer for each question in the quiz, and each answer 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 a 10-question quiz. You will need to store the key in an array. Ask the user to enter the answers for the quiz to be graded. As for the key, these can be entered on a single line. Again there needs to be one for each question. Note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. When the user has entered all of the answers to be graded, print the number correct and the percent correct.
Computers and Technology
1 answer:
kirill115 [55]3 years ago
7 0

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int questions, answer;

   cout<<"Questions: ";

   cin>>questions;

   int answerkey[questions];

   cout<<"Enter answer keys: ";

   for(int i = 0; i< questions; i++){

       cin>>answerkey[i];    }

   int correct = 0;

   cout<<"Enter answers: ";

   for(int i = 0; i< questions; i++){

       cin>>answer;

       if(answer == answerkey[i]){

           correct++;        }    }

   cout<<"Correct answers: "<<correct<<endl;

   cout<<"Percentage correct : "<<(100 * correct)/questions<<"%";

   return 0;

}

Explanation:

This declares the number of questions and the answers submitted to each equation

   int questions, answer;

Prompt to get the number of questions

   cout<<"Questions: ";

This gets input for the number of questions

   cin>>questions;

This declares the answerkey as an array

   int answerkey[questions];

Prompt to get the answer key

   cout<<"Enter answer keys: ";

This iteration gets the answer key for each question

<em>    for(int i = 0; i< questions; i++){</em>

<em>        cin>>answerkey[i];    }</em>

This initializes the number of correct answers to 0

   int correct = 0;

Prompt to get the enter the answers

   cout<<"Enter answers: ";

This iterates through the answer keys

   for(int i = 0; i< questions; i++){

This gets the answer to each question

       cin>>answer;

This compares the answer to the answer key of the question

       if(answer == answerkey[i]){

If they are the same, correct is incremented by 1

           correct++;        }    }

Print the number of correct answers

   cout<<"Correct answers: "<<correct<<endl;

Print the percentage of correct answers

   cout<<"Percentage correct : "<<(100 * correct)/questions<<"%";

You might be interested in
What is a coverage map used for
erastova [34]

Answer/Explanation:

A coverage map shows how much land something takes up or reaches to.

4 0
3 years ago
Read 2 more answers
What can you achieve if you divide your search engine marketing account into relevant campaigns and ad groups?.
Alchen [17]

Make sure that visitors receive relevant ads that pertain to their search query by segmenting your search engine marketing account into pertinent campaigns and ad groups.

<h3>What is search engine marketing? </h3>
  • A digital marketing tactic called search engine marketing (SEM) is used to make a website more visible in search engine results pages (SERPs).
  • The practice of promoting websites by making them more visible in search engine results pages, primarily through paid advertising, is known as search engine marketing.
  • The technique of obtaining traffic from search engines, either naturally or by paid advertising, is known as search engine marketing (also known as search marketing).
  • There are two basic sorts of search marketing: PSAs and SEOs (Search Engine Optimization) (Paid Search Advertising).

To learn more about search engine marketing, refer to:

brainly.com/question/20850124

#SPJ4

8 0
2 years ago
Whichmultiplexing technique involves signals composed of lightbeams?
Angelina_Jolie [31]

Answer:

3.WDM

Explanation:

WDM ( wavelength division multiplexing ) involves signals composed of light beams WDM is used in communication where fibers are used it is used for multiplexing of number of carrier signals  which are made of optical fibers by using different wavelength of laser light it has different wavelength so this WDM is used for signals composed of light beams it has property of multiplexing of signal

8 0
3 years ago
Additional rows and columns are inserted into a table using the
Paladinen [302]
The Option D , Table Tools Insert
6 0
2 years ago
_____ are the younger edge of gen y who have never lived without the internet or easy access to cell phones.
Sophie [7]

Generation Y are the people age 14-37, which means they are born 1977 - 2000.<span /><span>Tweens are the younger edge of gen Y who have never lived without the internet or easy access to cell phones.</span>
<span /><span>
</span>
8 0
3 years ago
Other questions:
  • What new deal programs were created to build dams to control flooding and generate electric power?
    13·1 answer
  • President Roosevelt's Fireside Chats were:
    12·2 answers
  • Alcohol is a gateway drug. true or false?
    13·2 answers
  • How are the internet and the World Wide Web different from each other
    14·1 answer
  • Dana downloads music into her computers random access memory, or ram, without authorization. this is?
    15·1 answer
  • The expression 10,785(1.0275)x represents the amount of money in an investment account with interest that compounds annually for
    14·2 answers
  • In Excel, you can sort a table by one or more columns by.
    7·1 answer
  • Which of these are examples of a bug?
    6·1 answer
  • A company database needs to store information about employees (identified by ssn, with salary and phone as attributes), departme
    7·1 answer
  • what is a program or collection of programs that enable a person to manipulate a visual images on a computer​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!