Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Has to be in C++ language The program first reads integer patientCount from input, representing the number of pairs of inputs to be read. Each
Has to be in C++ language
The program first reads integer patientCount from input, representing the number of pairs of inputs to be read. Each pair has a string and an integer. One Patient object is created for each pair and added to vector patientList. Write the FindLowestPatientAge() function in the Appointments class to return the lowest age of all the Patient objects. Ex: If the input is: 4 Ben 68 Aya 56 Dax 74 Gil 55 ihen the output is: Lowest patient age: 55 Note: The vector has at least one element. \( \begin{array}{ll}32 & \text { int patientCount; } \\ 33 & \text { unsigned int } i ; \\ 34 & \text { Patient currPatient; } \\ 35 & \text { string currName; } \\ 36 & \text { int currAge; } \\ 37 & \\ 38 & \text { cin >> patientCount; } \\ 39 & \text { for }(i=0 ; i> currName; } \\ 41 & \text { cin }>\text { currAge; } \\ 42 & \\ 43 & \quad \text { currPatient.SetNameAndAge(currName; currAge); } \\ 44 & \quad \text { patientList.push_back(currPatient); } \\ 45 & 3 \quad \\ 46 & \end{array} \) int main() \{ Appointments appointments; appointments. InputPatients (); cout "Lowest patient age:" appointments. FindLowestPatientAge () endl; return 0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started