Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Please! Just fill in where it says /* Your code goes here */ Use currCertificate's ReadHolderAndDivision() to read each pair of inputs,

C++ Please! Just fill in where it says " /* Your code goes here */ "

Use currCertificate's ReadHolderAndDivision() to read each pair of inputs, string holder and character division, until "stop" is read from input and currCertificate's ReadHolderAndDivision() returns false. If currCertificate's ReadHolderAndDivision() returns true, append currCertificate to vector certificateList.

Ex: If the input is Tim B Rob A Eli A Zoe A Kai B stop, then the output is:

Certificate: Tim, Division: B

Certificate: Rob, Division: A

Certificate: Eli, Division: A

Certificate: Zoe, Division: A

Certificate: Kai, Division: B

Code:

#include #include using namespace std;

class Certificate { public: bool ReadHolderAndDivision(); void Print() const; private: string holder; char division; };

bool Certificate::ReadHolderAndDivision() { string newHolder; cin >> newHolder; if (newHolder == "stop") { return false; } else { holder = newHolder; cin >> division; return true; } }

void Certificate::Print() const { cout << "Certificate: " << holder << ", Division: " << division << endl; }

int main() { unsigned int i; vector certificateList; Certificate currCertificate; bool result;

/* Your code goes here */

for (i = 0; i < certificateList.size(); ++i) { currCertificate = certificateList.at(i); currCertificate.Print(); } return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

Explain strong and weak atoms with examples.

Answered: 1 week ago

Question

Explain the alkaline nature of aqueous solution of making soda.

Answered: 1 week ago

Question

Comment on the pH value of lattice solutions of salts.

Answered: 1 week ago

Question

=+2 Why are international employment standards important to IHRM?

Answered: 1 week ago