Question: Integer dataSize is read from input. The remaining input consists of dataSize strings followed by dataSize doubles. Declare string vector patientList and double vector heightList,
Integer dataSize is read from input. The remaining input consists of dataSize strings followed by dataSize doubles. Declare string vector patientList and double vector heightList, each with dataSize elements. Then:
Read and store dataSize strings into patientList.
Read and store dataSize doubles into heightList.
Ex: If the input is:
4 Mai Mel Jan Tia 5.5 8.9 6.9 7.5
Then the output is:
Patient: Mai, Height: 5.5 Patient: Mel, Height: 8.9 Patient: Jan, Height: 6.9 Patient: Tia, Height: 7.5
------------------------------------------------------------------------------------------
#include
#include
using namespace std;
int main() {
int dataSize;
unsigned int i;
cin >> dataSize;
"YOUR CODE GOES HERE!!"
for (i = 0; i < patientList.size(); ++i) {
cout << "Patient: " << patientList.at(i) << ", ";
cout << "Height: " << heightList.at(i) << endl;
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
