Question: #include using namespace std; int main() { string fullName[]; double height[2]; cout getline(cin, fullName[0]); cout cin >> height[0]; cin.ignore(2, ' '); // gets rid of
![#include using namespace std; int main() { string fullName[]; double height[2];](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f5097ca7406_78066f5097c14986.jpg)
#include
using namespace std;
int main()
{
string fullName[];
double height[2];
cout
getline(cin, fullName[0]);
cout
cin >> height[0];
cin.ignore(2, ' '); // gets rid of in the buffer
cout
getline(cin, fullName[1]);
cout
cin >> height[1];
cin.ignore(2, ' '); // gets rid of in the buffer
cout
}
c++
1) Partially filled arrays Copy-paste your code from warm-up 2 into a new file as a starting point for this problem. Modify your main() function to allow any number of names and heights to be entered instead of just 2). The output should tell you all the people's names entered and their combined height in the same way the previous problem did it for two people). You will need to use a partially filled array to do this. (You can assume that there will not be more than 100 people.) Example (user input is underlined): How many people? 5 Please enter full name: AB Please enter AB's height: 1 Please enter full name: CD Please enter CD's height: 2 Please enter full name: EF Please enter EF's height: 3 Please enter full name: GH Please enter GH's height: 4 Please enter full name: IJ Please enter IJ's height: 5 If AB and CD and EF and GH and IJ stand on top of each other, their combined height will be 15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
