Computer Science Canada Jeremiah's Calculator |
Author: | Jeremiah [ Sun Jan 29, 2006 3:27 pm ] | ||
Post subject: | Jeremiah's Calculator | ||
hey all this is my first real program. im a grade 11 student in comp engineering, my first computer class, and this is my simple calculator. i know it culd be done much better but im pretty proud of my first program PS: if you know how i culd interface this with a home made joystick/ fire button, please help me; i have to do it and hand it in tomorrow
|
Author: | Delos [ Sun Jan 29, 2006 4:55 pm ] |
Post subject: | |
Not bad for a first attempt. I've seen worse, far worse. You do have quite a ways to go, mind you, but indented! I like the way you used 'div' instead of '/' to avoid strint() errors. However, it is a bit misleading to see a '/' and not get a division occuring. Try use reals instead of ints, you won't have to worry as much. It's still very buggy. For instance, clicking repeatedly on any of the operations crashes it. Why would someone do that? Because that's what people do... Here's a challenge: Remake this programme, but using the keyboard as input instead. Sounds easy, but a well proofed version will keep you occupied for quite some time. +bits for the effort. |
Author: | Jeremiah [ Sun Jan 29, 2006 10:15 pm ] |
Post subject: | |
thanx man, this is the first program with a purpose i ever made lol, so im glad it isnt completely a disaster. |
Author: | impact2cool [ Mon Jan 12, 2009 8:26 pm ] |
Post subject: | RE:Jeremiah\'s Calculator |
thnx man hey insted of using strint what if u used strreal |
Author: | andrew. [ Mon Jan 12, 2009 8:48 pm ] |
Post subject: | RE:Jeremiah\'s Calculator |
strreal would work, but you obviously have to define the variable as real instead of int. e.g. var number : real |
Author: | syntax_error [ Tue Jan 13, 2009 2:36 am ] |
Post subject: | RE:Jeremiah\'s Calculator |
Look into for loops for parts of your code that tend to repeat themselves in an sequencial manner. Such as the drawing of the cal you have done. |
Author: | Nick [ Tue Jan 13, 2009 7:12 am ] |
Post subject: | RE:Jeremiah\'s Calculator |
suggestions are great and all but this is 3 years old and the OP has 7 total posts... I doubt here's still around to hear the criticism |
Author: | evilisgood [ Wed May 13, 2009 10:59 am ] |
Post subject: | RE:Jeremiah\'s Calculator |
how do you make the buttons work for the calculator? |
Author: | DanTheMan [ Fri May 15, 2009 8:50 am ] |
Post subject: | Re: RE:Jeremiah\'s Calculator |
evilisgood @ Wed May 13, 2009 10:59 am wrote: how do you make the buttons work for the calculator?
http://compsci.ca/v3/viewtopic.php?t=3583 |
Author: | Wajih [ Fri Jan 14, 2011 10:01 pm ] |
Post subject: | RE:Jeremiah\'s Calculator |
hey guys i know i am very late, but jeremiah and/ or others : can you please explain what you did to get 2+ digit numbers? mine can only do single digit operations. i do not know how to make it a double, triple or higher digit calculator |
Author: | Insectoid [ Fri Jan 14, 2011 10:31 pm ] |
Post subject: | RE:Jeremiah\'s Calculator |
Just keep a running total of the current value. Always use that as the 'left' value in a calculation and update it as the program executes. |
Author: | Wajih [ Fri Jan 14, 2011 11:26 pm ] |
Post subject: | RE:Jeremiah\'s Calculator |
but my program is a bit different. there are tow sets of numbers. the numbers on the left side represent num, while the numbers 0n the right side represent num2. if you want to creata total for each time a number has been entered, would you have t create a new variable and loop it? |