Posted: Thu Mar 06, 2003 8:25 pm Post subject: example problem??? I'm totally lost!
ok so here's the program
assuming that the variables are already declared
put "Enter a number. To end the program type stop"
exit when number=-999
put "The number of number's entered is", count
How do u change the program to read the series of numbers and determine the total sum of the numbers entered.
help would be great!!!!!!!
Posted: Thu Mar 06, 2003 8:30 pm Post subject: (No subject)
same thing, but instead of counting how many number were entered (+1 through each run) you add up the total (current total + number entered)
put "Enter a number. To end the program enter -1"
exit when number=-1
total := total + number
put "the total is: ", total
it should be -1 instead of "stop" because that way you'd have to get input as string and convert it to integer with strint() and its extra work... so just -1 or 0 or w/e other number you dont think user would use.