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

#1 2013-04-12 09:16:26

liban1
New Scratcher
Registered: 2013-03-22
Posts: 4

calculator

basically i want to create a simple calculator with 0-9 interface, a plus sign,a minus sign , a clear button,an equals sign and a display. the calculator should be able to perform addition and subtraction of integer values. These integer values should be input by pressing the keys on the calculator interface. the system need only to work up to 999.

please help me am very stuck.

Thank you

Offline

 

#2 2013-04-12 09:19:14

5632622roblox
Scratcher
Registered: 2011-06-17
Posts: 20

Re: calculator

OK. I am expert math guy (for a third grader-I don't know what Nil means)  smile
big_smile  XD


http://scratch.mit.edu/projects/Hypnosis101/2941929
for boys

Offline

 

#3 2013-04-12 09:21:52

5632622roblox
Scratcher
Registered: 2011-06-17
Posts: 20

Re: calculator

liban1 wrote:

basically i want to create a simple calculator with 0-9 interface, a plus sign,a minus sign , a clear button,an equals sign and a display.

I will add a x time and division.


http://scratch.mit.edu/projects/Hypnosis101/2941929
for boys

Offline

 

#4 2013-04-12 09:23:27

liban1
New Scratcher
Registered: 2013-03-22
Posts: 4

Re: calculator

basically i want to create a simple calculator with 0-9 interface, a plus sign,a minus sign , a clear button,an equals sign and a display. the calculator should be able to perform addition and subtraction of integer values. These integer values should be input by pressing the keys on the calculator interface. the system need only to work up to 999.

please help me am very stuck.

Thank you

Offline

 

#5 2013-04-12 09:33:05

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: calculator

I have a basic calculator perhaps you could work of that? - Good Luck!  smile


http://i45.tinypic.com/idumbk.png

Offline

 

#6 2013-04-12 09:40:38

liban1
New Scratcher
Registered: 2013-03-22
Posts: 4

Re: calculator

can you create a new one for me please or can you only create the script for me  big_smile

Offline

 

#7 2013-04-13 18:25:30

Liamadams
Scratcher
Registered: 2012-12-08
Posts: 100+

Re: calculator

liban1 wrote:

can you create a new one for me please or can you only create the script for me  big_smile

we cant just do it all for you. its your project!  yikes


http://i39.tinypic.com/3309476.jpg

Offline

 

#8 2013-04-13 20:46:59

Maltese_Falcon
Scratcher
Registered: 2013-03-25
Posts: 100+

Re: calculator

I'd use variables.

(Number1)//first number you enter
(Number2)//second number you enter
(Operation)//Whether you want to add or subtract
When gf clicked
Set (Number1) to [No Input]
Set (Number2) to [No Input]
Set (Operation) to [No Input]
Set (Sum/Difference) to [no output]
Hide variable (Number1)
hide variable (Number2)
hide variable (Operation)
Hise variable (Sum/difference)

When [Button1] clicked
If <(Number1) = [No Input]> //If nothing's been input yet
Set (Number1) to [1]
End
If <Not <(Number1) = [No Input]>> //If it has an input
Set (Number2) to [1]
End
Do that for all of the number buttons (and you could do it for the number keys)
You could also have some costumes for the calculator display for the numbers
Then,
When [+] clicked
Set [Sum/Difference] to <(Number1) + (Number2)>

When [-] clicked
Set [Sum/Difference] to <(Number1) - (Number2)>
NOTE: I just realized that the way I did that doesn't allow you to do multiple digit numbers. You can make a slight variation to fix that.

Offline

 

Board footer