Computer Science Canada Simple program i made |
Author: | Mathwiz [ Thu Nov 02, 2006 10:49 am ] |
Post subject: | Simple program i made |
var number1 : real var number2 : real var total : int var symbel : real var number : real put " please enter your first number" get number1 put " please enter your lst number" get number2 put " please enter number" put " 1. Addition" put "2. Subtraction" put "3. Multiplication" put "4. Division" get number if number = 1 then put number1, "+ ", number2,"=", number1 + number2 elsif number = 2 then put number1, "-", number2,"=",number1-number2 elsif number=3 then put number1, "*",number2,"=", number1*number2 elsif number= 4 then put number1,"/",number2,"=", number1/number2 elsif number>4 then put "You have to enter a number between 1-4 not 5-10" put "and you call yourself Smart." end if |
Author: | jamonathin [ Thu Nov 02, 2006 11:50 am ] | ||||
Post subject: | |||||
Next thing you should do is learn procedures (or functions) and loops, then you can expand on your program. What procedures/functions and loops will do for your program is, make it run more than once. Here's a small example of procedures and loops.
Edit: Next time please use code tags like such ![]()
|
Author: | abysspell [ Fri Nov 03, 2006 1:51 pm ] |
Post subject: | |
Wow, thats an old thing. I completely forgot about it. You might want to check your output. it says to enter your first number twice. |
Author: | rdrake [ Fri Nov 03, 2006 2:27 pm ] | ||
Post subject: | |||
abysspell wrote: You might want to check your output. it says to enter your first number twice. Awha? Try this.
|