Question: QUESTION ONE: PART A: #include #include using namespace std; class Participant { public: void SetNameAndAge(string newName, int newAge); int GetAge() const; private: string name; int

QUESTION ONE:

PART A:

QUESTION ONE: PART A: #include #include using namespace std; class Participant {

#include #include using namespace std;

class Participant { public: void SetNameAndAge(string newName, int newAge); int GetAge() const; private: string name; int age; };

void Participant::SetNameAndAge(string newName, int newAge) { name = newName; age = newAge; }

int Participant::GetAge() const { return age; }

class Clinic { public: void InputParticipants(); double FindAverageParticipantAge(); private: vector participantList; };

void Clinic::InputParticipants() { int participantCount; unsigned int i; Participant currParticipant; string currName; int currAge; cin >> participantCount; for (i = 0; i > currName; cin >> currAge; currParticipant.SetNameAndAge(currName, currAge); participantList.push_back(currParticipant); } }

// ENTER THE MISSING PIECE OF CODE HERE AND TEST IT IN C++ (THANK YOU)

int main() { Clinic clinic; clinic.InputParticipants(); cout

PART B:

public: void SetNameAndAge(string newName, int newAge); int GetAge() const; private: string name;

#include using namespace std;

int main() { int currentValue; int previousValue; // ENTER THE MISSING PIECE OF CODE HERE AND TEST IT IN C++ (THANK YOU)

return 0; } THANK YOU >:D

The program first reads integer participantCount from input, representing the number of pairs of inputs to be read. Each pair has a string and an integer. One Participant object is created for each pair and added to vector participantList. Write the FindAverageParticipantAge() function in the Clinic class to return the average age of all the Participant objects. Ex: If the input is: 4 Gus 70 Ari 33 Kai 27 Avi 89 then the output is: Average participant age: 54.75 Note: The vector has at least one element. Read integers from input until an integer read is less than or equal to the previous integer read. For each integer read, output the integer followed by " is in a strictly increasing sequence." Then, output the last integer read followed by " breaks the sequence." End each output with a newline. Ex: If the input is 23451278, then the output is: 2 is in a strictly increasing sequence. 3 is in a strictly increasing sequence. 4 is in a strictly increasing sequence. 5 is in a strictly increasing sequence. -12 breaks the sequence. Note: Input has at least two integers

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!