-
Guidance from anyone?
I have tried to write a repetition structure that will prompt the user for a value, read that value into the variable price, increment the variable total by the value entered, and continue repeating the process until total is greater than 10.00 or until the user enters 0 as a value to indicate that they are finished entering values.
But I did not quite understand the concept of repetition structure, so I did not get anywhere.
Is anyone willing to guide me in the right direction a little?
thanks
-
probably easiest to use a while loop.
have a variable for the total, a variable for the value entered.
check if total is less than or equal to 10 in the condition of the while loop.
use an if statement after the user inputs the value to see if it is 0. if it is, break out of the loop.
try coding that, and if you still need help, post what you have tried and we can help you from there.
-
you need to look into while loops.
http://www.cprogramming.com/tutorial/lesson3.html
the || operator will come in handy for this as well
-
[cough] do while [/cough]