Pages: 1
Topic closed
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
is this what you want scratch.mit.edu/projects/TRocket/2019574
Offline
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
Offline
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).
Offline
Topic closed
Pages: 1