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

#1 2011-09-08 14:52:43

josh111111
New Scratcher
Registered: 2011-09-08
Posts: 4

How do i put the following sentences in scratch

1.Declare the number n //which is the input from the keyboard.
2.Declare the sum and initialise it to zero.
3.Compute the sum
do
begin
input number n.
increment sum with n
end while number n is equals to zero
end
4.Display the sum.

Offline

 

#2 2011-09-08 15:02:44

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

Re: How do i put the following sentences in scratch


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

Offline

 

#3 2011-09-08 15:19:53

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

Re: How do i put the following sentences in scratch

lol - this is the second posting I've seen for the same algorithm this week - I've posted my reply elsewhere - wish I'd had internet forums 30 years ago when I started to learn computers at school  tongue

Offline

 

#4 2011-09-08 16:32:22

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

Re: How do i put the following sentences in scratch

You can't "declare" variables in Scratch (during Run time).  Fortunately, to do what you are asking, you'll only need one variable (and the "answer" block).


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

Offline

 

Board footer