Here is the code that I have so far. What I'm trying to do is make the program display the number of children over 60 inches and their height. The program now shows the number of children over 60 inches, but I also need it to display the height of the children over 60 inches. Thanks in advance!
#include <iostream>
using namespace std;
int main ()
{
double childHeight[10];
int numChildren = 0;
for (int x = 0; x < 10; x = x + 1)
{
childHeight[x] = 0.0;
}
cout << "You will be asked to enter the height of 10 children." << endl;
for (int x = 0; x < 10; x = x + 1)
{
cout << "Enter the height of child: ";
cin >> childHeight[x];
}
cout << "The number of children over 60 inches are: "<< endl;
for (int x = 0; x < 10; x = x + 1)
{
if (childHeight[x] > 60)
{
numChildren = numChildren + 1;
}
}
cout << numChildren << endl;
system("pause");
return 0;
}