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
Lostsunrise [7]
1 year ago
7

Write a C++ program to grade the answers to a true-false quiz given to students in a course. The quiz consists of 5 true-false q

uestions. Each correct answer is worth 2 points.
Computers and Technology
1 answer:
Eddi Din [679]1 year ago
7 0

The quiz program is an illustration of loops and conditional statements

  • Loops are used to perform repetition
  • Conditional statements are used to make decisions

<h3>The quiz program</h3>

The quiz program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

using namespace std;

int main(){

   //This prints the instruction

   cout<<"Enter T/t for True; F/f for False\n";

   //This initializes the question

   string questions[5] = { "Q1", "Q2", "Q3", "Q4", "Q5"};

   //This initializes the correct options

   char options[5] = { 'T','T','F','F','T'};

   //This declares the user response

   char opt;

   //This initializes the score to 0

   int score = 0;

   //This loop is repeated 5 times

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

       //This prints the current question

       cout << i + 1 <<". "<<questions[i]<<"\nAnswer: ";

       //This gets the user response

       cin>>opt;

       //If the user response is correct

       if(toupper(opt) == options[i]){

           //The score is incremented by 2

           score+=2;

       }

   }

   //This prints the total score

   cout<<"Score: "<<score;

   return 0;

}

Read more about loops at:

brainly.com/question/19347842

You might be interested in
According to the text, the three IT trends that are having the greatest impact on the IT environment are:
maksim [4K]

Answer:

B. GRID COMPUTING , ON - DEMAND COMPUTING AND REAL TIME COMPUTING

Explanation:

Grid computing, on-demand computing and real time computing are currently the most impactful information technology processes. The Grid computing from example entails distributed computing whereby computing resources are distributed across different systems for a computing task. This is seen in server systems where a super virtual computer composed of a network of computers are connected to share resources and perform large tasks. This form of computing has majorly affected and improved complex computing tasks today.

On demand and real time computing are also other notable trends in IT with real time computing bringing the power of live and direct coverage of information to our screens and on demand making it possible for the average user to access computing resources as needed such as in the services of cloud computing providers

4 0
3 years ago
What can be designed to create annoying glitches or destroy data
Yanka [14]
Viruses can cause this.
3 0
3 years ago
Please describe the role of games in modern society!
ohaa [14]
It is to Entertainment.
5 0
2 years ago
Read 2 more answers
Omega Software Inc. is currently running a training program for employees to upgrade their software skills so that they are able
MArishka [77]

Answer:

Omega Software is attempting to make a change in the area of people.

Explanation:

Types of Organizational Change:

Most organizations have to go through a change to keep up with the changing market dynamics, trends and technologies. There are four major types of organizational change:

  1. Structural
  2. Strategic
  3. People
  4. Process

People change:

One of the organizational change is people change where organizations strive towards the improvement of their employee's skills set and productivity. This is usually achieved by launching various specialized and general training programs for employees to enhance their knowledge and widen their skills set so that they can work more efficiently for the organization.

Therefore, it can be concluded that Omega Software is attempting to make a change in the area of People.

3 0
3 years ago
An administrative assistant types a document, saves, and prints. The assistant is using _____.
9966 [12]
The answer to your question is software. 
3 0
2 years ago
Other questions:
  • When does a kernel panic occur?
    12·2 answers
  • The ____ contains the computer's "brain," the central processing unit (CPU).
    5·2 answers
  • Examples of apps include pop-up windows, validation of webform inpts and images that change when a cursor passes over them
    12·1 answer
  • 3. The invention of the transistor was important to the development of computers because it
    5·1 answer
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • Why do you think Jacinda believed what people told her about her own beauty? Even if you understand that what you see on social
    13·1 answer
  • Ha Yoon sees funny quotes on top of images frequently in her social media feed. One day, she has an idea for one of her own. Whi
    11·1 answer
  • What does business informWhat does business information management do?
    12·1 answer
  • Q2: Mark True or False in the corresponding Answer sheet (0.5 point each)
    8·1 answer
  • CS902 Module3 Homework1
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!