Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications Dexa 2021 Workshops Biokdd Iwcfs Mlkgraphs Al Cares Protime Alsys 2021 Virtual Event September 27 30 2021 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Anna Fensel ,Jorge Martinez-Gil ,Lukas Fischer

1st Edition

3030871002, 978-3030871000

More Books

Students also viewed these Databases questions

Question

1. Define mass and mediated communication

Answered: 1 week ago