Hi I am new to creating algoritms
Can someone help me in creating a computer algoritm which suits the following criteria
The expected behavior of the program is as follows.
1.The program informs the user that it will compute the sum of a 0-terminated sequence of numbers.
2.The program prompts the user for each number.
3.The user inputs each number, one at a time.
4.Each number given by the user is added to a running total.
5.When the user gives 0 as input, the program finishes by displaying "The sum is " followed by the sum of all numbers entered by the user.
Write an algorithm to compute the sum of a 0-terminated sequence of numbers given by the user.
Thanks
Offline
sounds like a homework assignment to me! hehehe
Offline
ok... kinda difficult to explain this without writing it for you... take a look at this and then maybe try and put your own version together?
http://scratch.mit.edu/projects/Ratty1967UK/2030447
Last edited by Ratty1967UK (2011-09-15 14:53:57)
Offline
is this what you want:
scratch.mit.edu/projects/TRocket/2019574
your the 3rd person today wanting this script :p
Offline
TRocket wrote:
is this what you want:
scratch.mit.edu/projects/TRocket/2019574
your the 3rd person today wanting this script :p
Ratty1967UK wrote:
sounds like a homework assignment to me! hehehe
![]()
Offline
Use the ask and wait block to receive input... I don't want to say anything else (you know, in the spirit of academic honesty )
Last edited by MoreGamesNow (2011-09-08 16:30:44)
Offline