Question: In c++, only solution code pls thank u The program first reads integer certificateCount from input, representing the number of pairs of inputs to be

In c++, only solution code pls thank u

The program first reads integer certificateCount from input, representing the number of pairs of inputs to be read. Each pair has a string and an integer. One Certificate object is created for each pair and added to vector certificateList. Write the PrintCertificatesInRange() function in the RecordsManager class using Print() to output all the Certificate objects with level between 4 and 8, both inclusive.

Ex: If the input is:

5 Rob 4 Jan 2 Dan 8 Ana 10 Eve 1

then the output is:

Certificate: Rob, Level: 4 Certificate: Dan, Level: 8

Note: The vector has at least one element.

#include #include using namespace std; class Certificate { public: void SetHolderAndLevel(string newHolder, int newLevel); int GetLevel() const; void Print() const; private: string holder; int level; }; void Certificate::SetHolderAndLevel(string newHolder, int newLevel) { holder = newHolder; level = newLevel; } int Certificate::GetLevel() const { return level; } void Certificate::Print() const { cout << "Certificate: " << holder << ", Level: " << level << endl; } class RecordsManager { public: void InputCertificates(); void PrintCertificatesInRange(); private: vector certificateList; }; void RecordsManager::InputCertificates() { int certificateCount; unsigned int i; Certificate currCertificate; string currHolder; int currLevel; cin >> certificateCount; for (i = 0; i < certificateCount; ++i) { cin >> currHolder; cin >> currLevel; currCertificate.SetHolderAndLevel(currHolder, currLevel); certificateList.push_back(currCertificate); } } /* Your code goes here */ int main() { RecordsManager recordsManager; recordsManager.InputCertificates(); recordsManager.PrintCertificatesInRange(); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!