Howdy - am in the process of creating a program where a user enters the number of people in their family. The loop is suppose to loop the number of member in their family.. I got it to loop but it gives me a error stating that the int needs to be a boolean.. i am not really sure what it asking me.
for(int count = 1; count < familyMembers; count--) System.out.println("enter member one's first name, last name, age, weight, height.");
I did that all the way to six.. we have not covered arrays so I do not think i can work ahead.
the whole program is to take all family info and avgerage out the age, weight, height; tell who is the oldest, tallest, & fatest. I could send what I have thus far.. i think its about 1/2 done, but its due by friday. thank you much for your time and I look forward to hearing from you.
1. Format your code using the java tags as shown in the "Formatting your post" section
2. To your problem:
The result of 'count = 2' is integer, not boolean. This way you assign a value. The correct syntax would be 'if (count == 2)'
3. Endless loop 'for(int count = 1; count < familyMembers; count--)' As long as familyMembers is not <= 0 this loop will run for a very long time. You need an increment, not a decremnt 'for(int count = 1; count < familyMembers; count++)'