Question: This code it's not working, fix it for me please #include using namespace std; class People { string name; double height; public: void setName(string name)

This code it's not working, fix it for me please

#include using namespace std;

class People { string name; double height; public: void setName(string name) { this->name = name; } void setHeight(double height) { this->height = height; } double getHeight() { return height; } string getName() { return name; } }; int main() { const int size = 100; string name; double height; double tallest; double smallest; int groupSize; int tallindex, smallindex; cout << "How large is your group? 100 is the limit: "; cin >> groupSize;

People people[size];

for (int i = 0; i> name; cout << " Person " << i + 1 << " height:"; cin >> height; people[i].setName(name); people[i].setHeight(height); cout << endl; }

tallest = people[0].getHeight(); smallest = people[0].getHeight();

for (int i = 0; i

tallest = people[i].getHeight(); tallindex = i; }

if (smallest>people[i].getHeight()) { smallest = people[i].getHeight(); smallindex = i; }

}

cout << " The tallest person is " << people[tallindex].getName() << endl; cout << " The smallest person is " << people[smallindex].getName() << endl; return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!