Question: 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 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
