Computer Science Canada

2 digit calculator

Author:  mother teresa [ Wed Feb 03, 2010 10:44 pm ]
Post subject:  2 digit calculator

calculate 2 single digits
either
+
-
*
/

Author:  Turing_Gamer [ Thu Feb 04, 2010 8:20 am ]
Post subject:  Re: 2 digit calculator

It works but I'd rather stick with the Programs -> Accessories -> Calculator Laughing
It is very basic. If you want you could develop it to find the tangent, the constant and so on. Turing can do that...

Author:  mother teresa [ Thu Feb 04, 2010 11:57 am ]
Post subject:  RE:2 digit calculator

lol i know

Author:  y4y [ Thu Feb 04, 2010 4:03 pm ]
Post subject:  Re: 2 digit calculator

no offense but this is a very simple program and you could have implemented a nice GUI or use mouse where and pictures.
seems as if it was assigned to you hence the title "question 8".

I would suggest to stop posting every question you complete for class and invest your time in a more complex program then post it.

sorry if I seem like a jerk but honestly these programs you have been posting weren't worth downloading.

Author:  mother teresa [ Thu Feb 04, 2010 4:31 pm ]
Post subject:  RE:2 digit calculator

look im proud of my turing work because i just started using turing three days ago ok?

Author:  Insectoid [ Thu Feb 04, 2010 4:38 pm ]
Post subject:  RE:2 digit calculator

It's fine that you're proud, but just 'cause you're proud doesn't mean it's worth posting. If you make something huge and impressive or have a clever bit of code, feel free to post it, but really, hundreds of kids come and go to this site. We've seen just about every basic program any teacher has ever assigned to a student. Just assume that anything your teacher specifically tells you to make (ie make a clock animation), we've already seen it. When you've spent two weeks on a program, then it will be worth showing us.


You're not a bad programmer (hard to tell this early), so don't think I'm saying that, but don't bother posting until you've created something of substance.

Author:  y4y [ Thu Feb 04, 2010 4:42 pm ]
Post subject:  Re: RE:2 digit calculator

mother teresa @ Thu Feb 04, 2010 4:31 pm wrote:
look im proud of my turing work because i just started using turing three days ago ok?


Exactly my point. You are a beginner focus more of your time learning and working than feeling accomplished by doing something that is so basic .

If you want to feel accomplished then show your friends or someone who cares because the "usuals" around here know much more sophisticated concepts and programming languages.

Personally i am a noob as well but I don't post every crappy program I made/make.

Turing is fairly easy therefore getting ahead is easy read some tuts posted on here add nice GUI to your program and I won't complain. the reason I am telling you this is because you posted TWO of your questions/assignments which everyone learns how to complete in the first few days and you will probably post more......

Author:  Turing_Gamer [ Thu Feb 04, 2010 9:00 pm ]
Post subject:  Re: 2 digit calculator

I suggest working on small tasks using different commands (boolean for example) then incorporate them into your programs. Don't post them.
Then start to develop your skills by using the methods learned and creating complex programs. Post these if worth it and lasts at least 5 - 10 mins.

Author:  mother teresa [ Fri Feb 05, 2010 8:03 pm ]
Post subject:  RE:2 digit calculator

fair enough

Author:  MatS [ Mon Feb 27, 2012 9:59 pm ]
Post subject:  RE:2 digit calculator

divide by 0?
here's a fix i made:

var a:real:=0
var b:real:=0
var operator:string

put "enter a number"
get a
put "enter a second number"
get b
put "enter an operator"
get operator

if (operator = "*") then
put a*b
elsif (operator = "+") then
put a+b
elsif (operator = "-") then
put a-b
elsif (operator = "/") then
if b = 0
then put "error: cannot divide by 0"
else put a/b
end if
end if


: