Integer Adjustment Problem

ffghfh
Last edited on
If you want to repeat an action until a condition is true, you probably want to use a loop structure. Since you don't know exactly how many times you're going to need to repeat in advance, I'd go with a while loop.

e.g.
while (temp is not within comfortable range)
--ask user for adjustment
--calculate temperature with adjustment

Seems like these should be reversed to output the request to the user to enter a temperature and then cin the response?
1
2
cin>> temp;
cout<< "enter a starting temp";



There's a typo here (] instead of =) and I don't see that the total variable has been defined anywhere.
total ] (temp+adjust);
Topic archived. No new replies allowed.