Question: I need help finishing this. Show the output Please #include #include using namespace std; struct people { string name; float feet; float inch; }; int
I need help finishing this. Show the output Please
#include
};
int main() { int const SIZE = 100; people p[SIZE]; int groupSize; double tallest; double smallest; int tallindex, smallindex; int i = 0;
cout << "How large is your group? 100 is the limit: "; cin >> groupSize;
while (i
for (int i = 0; i < groupSize; i++) { if (tallest < p[i].feet) {
tallest = p[i].feet; tallindex = i; }
if (smallest > p[i].feet) { smallest = p[i].feet; smallindex = i; } } cout << " The tallest person is " << p[tallindex].name << " at " << p[i].feet << " feet " << p[i].inch << " inches."<< endl; cout << " The smallest person is " << p[smallindex].name << " at " << p[i].feet << " feet " << p[i].inch << " inches." << endl;
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
