This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-09-07 17:57:19

djrox
New Scratcher
Registered: 2011-09-07
Posts: 3

Help with algorithms

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

 

#2 2011-09-07 18:20:14

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Help with algorithms

sounds like a homework assignment to me! hehehe  big_smile

Offline

 

#3 2011-09-07 18:21:12

djrox
New Scratcher
Registered: 2011-09-07
Posts: 3

Re: Help with algorithms

Ratty1967UK wrote:

sounds like a homework assignment to me! hehehe  big_smile

It is I dont want you to do this for me. I just some help to get started

Offline

 

#4 2011-09-08 14:58:37

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Help with algorithms

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

 

#5 2011-09-08 15:25:14

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Help with algorithms

is this what you want:
scratch.mit.edu/projects/TRocket/2019574
your the 3rd person today wanting this script    :p


http://i.imgur.com/1QqnHxQ.png

Offline

 

#6 2011-09-08 15:34:31

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Help with algorithms

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  big_smile

Offline

 

#7 2011-09-08 16:30:35

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Help with algorithms

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  hmm  )

Last edited by MoreGamesNow (2011-09-08 16:30:44)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer