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
defon
1 year ago
15

The local Driver's License Office has asked you to write

Computers and Technology
1 answer:
Y_Kistochka [10]1 year ago
6 0

One of the most popular object-oriented programming languages is C++. Stroustrup created C++ by adding object-oriented features to the C programming language.

<h3>How do you write a program in C++?</h3>
  • Some people believe that the open-source C++ IDE Dev C++ is one of the finest. However, it may be used exclusively on Windows and macOS. It contains capabilities like profiling, integrated debugging, syntax highlighting, code completion, tool managers, and GCC-based compilers.
  • Many people believe that C++, an object-oriented programming (OOP) language, is the finest language for developing complex applications. The C language is a superset of C++.

#include <iostream>

#include <string>

#include <iomanip>

#include <cctype>

using namespace std;

class TestGrader

{

private:

string answer[20];

public:

void setKey(string[]);

void grade(string[]);

};

/*********************************************************************/

void TestGrader::setKey(string correct[])

{

for (int x = 0; x < 20; x++)

{

 answer[x] = correct[x];

}

}

void TestGrader::grade(string test[])

{

int right = 0;

int wrong = 0;

int count = 0;

for (int x = 0; x < 20; x++)

{

 if (test[x] == answer[x])

 {

  right += 1;

  count += 1;

 }

 else if (test[x] != answer[x])

 {

  wrong += 1;

 }

}

if (count >= 15)

{

 cout << "Congratulations you have passed the driver's license exam" << endl;

}

else

{

 cout << "You failed the driver's license exam" << endl;

}

cout << "You got a total of " << right << " right answers and a total of " << wrong << " wrong answers in the test" << endl;

cout << "You got questions ";

for (int x = 0; x < 20; x++)

{

 if (test[x] != answer[x])

 {

  cout << x + 1 << " ";

 }

}

cout << "wrong" << endl;

}

int main()

{

string answers[20] = { "B", "D", "A", "A", "C", "A", "B", "A", "C", "D", "B", "C", "D", "A", "D", "C", "C", "B", "D", "A"};

TestGrader exam;

exam.setKey(answers);

string yourTest[20];

int choice;

do

{

 for (int x = 0; x < 20; x++)

 {

  cout << "Enter the answer for question " << x + 1 << ": ";

  cin >> yourTest[x];

  while (yourTest[x] > "D"  || yourTest[x] < "A")

  {

   cout << "Please enter from A-D: ";

   cin >> yourTest[x];

  }

 }

 exam.grade(yourTest);

 cout << endl << "Enter -1 to quit, else enter any number to retake the exam: ";

 cin >> choice;

} while (choice != -1);

return 0;

}

To learn more about C++ refer,

brainly.com/question/15411348

#SPJ4

You might be interested in
Which is a reason why an organization might get rid of its entire information processing unit?
Rasek [7]

Answer: To hire good IT staff

Explanation:

  The organization hire the good information technology staff so that it can help in the development and increase the productivity of the organization. The stronger employees means the company become more strong in terms of growth and productivity.  

The organization always maintain the quality of the employees so that it can help to increase the quality of the projects and services that is provided to the users.

The good information technology (IT) staff can deliver the good products and can also providing the relevant services  for the organization.

6 0
3 years ago
What is hardware?
Aleonysh [2.5K]
The answer would be the first option, all elements of a computer
6 0
3 years ago
What feature do you need on a computer if you want to take it on vacation to another continent?A. Dual-voltage selector switch B
777dan777 [17]

Answer:

dual inline module is correct answer .

6 0
3 years ago
What is the meaning of the word joystick
Roman55 [17]
<span>The meaning of Joystick is the control column of an aircraft</span>
4 0
3 years ago
Read 2 more answers
Java variable is the name of a Group of answer choices numeric data value stored in memory data value stored in memory that can
artcher [175]

Answer:

Java variable is the name of a group of data value stored in memory that can change its value but cannot change its type during the program's execution

Explanation:

Generally, a variable is a temporary location in the memory where data are stored in a computer program. Values in the variable can always be change during the course of program execution.

The equal sign ( = ) is use to assign and identify a variable. The value to be stored in the variable is always at the right of the equal sign, while the variable name is always at the left of the equal sign.

5 0
3 years ago
Other questions:
  • If you're found to be at fault in _____, your driver license will be canceled within 90 days unless you complete a 12-hour Advan
    10·2 answers
  • A. True
    5·1 answer
  • You friends parents are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
    10·1 answer
  • How do I do the matrix falling code on command prompt? Need Help?!
    14·1 answer
  • Give two differences between a source and an object program​
    10·1 answer
  • Microprocessors can’t directly understand programming languages, so programs have to be converted into _____________ that corres
    15·1 answer
  • Which of the following sections of a business plan comes first but should be written last?
    11·2 answers
  • Video games, regardless of their level of realish, had added a new dynamic to the world games and Entertainment the ability to s
    9·1 answer
  • What are ways to create a study schedule? Check all that apply.
    5·2 answers
  • Define basic logical gates with its symbol, algebraic expression and truth table.​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!