Asked by Mike

Write a program that will prompt for, receive and total a collection of payroll amounts entered at the terminal, until a sentinel amount of 999 is entered. After the sentinel has been entered, display the total payroll amount to the screen.

Answers

Answered by oobleck
sum=0
loop {
print "Enter amount: "
read amount
if amount == 999 then exit loop
sum += amount
}
print "Total: ", sum
There are no AI answers yet. The ability to request AI answers is coming soon!

Related Questions