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 section is optional in a resume?
suter [353]

<em>Career Objectives </em>are pointless in a resume, Things like experience, Contact details, education and skills, help the company decide whether to take you or not, in accordance with their needs. They don't need to know why you want the job as opposed to how you could help them.

7 0
3 years ago
Recently, a serious security breach occurred in your organization. An attacker was able to log in to the internal network and st
natulia [17]

Answer: Geotagging was enabled on her smartphone

Explanation:

The security weakness that is the most likely cause of the security breach is that geotagging was enabled on the vice president's smartphone.

Geotagging, occurs when geographical identification metadata are added to websites, photograph, video, etc. Geotagging can be used to get the location of particular place.

In this case, since geotagging was enabled on her smartphone, it was easy for the attacker to locate her house.

8 0
3 years ago
What quantities are measured by the following sensors:
grigory [225]

Answer:

D

Explanation:

3 0
3 years ago
Identify the command on a local desktop CMD that will verify which group policies have been applied to the workstation. SELECT T
fomenos

Answer:

The answer is gpupdate

Explanation:

gpupdate command is used to update Group policies in Windows operating system Domain.

There are different options to use with the gpupdate but one of the most used option is the '/force' which will reapply all policy settings

8 0
3 years ago
A(n) _____ is a local connection point-of-presence that connects a variety of high-performance networks, and its main function i
kirza4 [7]

Answer:

GigaPOP

Explanation:

<em>A gigabit point of presence, also known as GigaPOP is a single entry point to Internet2, which is a high-speed IP network managed by institutions and other organizations. Gigabit Points of Presence generally handle data transmission rates of one gigabit per second or more.</em>

8 0
2 years ago
Other questions:
  • When an object is selected, it is surrounded by ________, which allow you to change the size of the object.?
    5·1 answer
  • The term _____ refers to an organization of components that define and regulate the collection, storage, management and use of d
    7·2 answers
  • Discuss how advertising on the Web affects search results and the ethical dilemmas associated with it.
    5·1 answer
  • Calculate the addition and multiplication of N integers numbers read from the keyboard
    6·1 answer
  • Llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    7·1 answer
  • Write a try block in which you prompt the user for an integer and display the name in the requested position in the names array.
    11·1 answer
  • According to a case study in one of our weekly chapter reading, nearly..................... percent of all employees send work e
    11·2 answers
  • Write a technical term for following statements
    15·1 answer
  • You’ve been given a new cell phone with a 2 gigabyte data plan. You plan to use your phone for text messages, images, video, and
    13·1 answer
  • Why does my wifi keep disconnecting and reconnecting?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!