HOW TO MAKE A CALCULATOR ON TURING-plz help
Author |
Message |
geoking
|
Posted: Wed Jan 07, 2009 4:55 pm Post subject: HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
hi, i have this very big assignment for my grade 10 comp.sci class,
wat we have to do is make a calculator on turing using mouse commands, loops and so on.
the calculator must have numbers 0-9 and operations --*, = , +, -, /, clear button, and decimal sidn (.),
it must allow multiply numbers to be inputed, also the nubers inputed must be shown.
if anyone could please help,,
thank you:) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
DanielG
|
Posted: Wed Jan 07, 2009 5:21 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
looks like an annoying problem, but ignore this line and go to next:
first of all, split your problem into multiple parts, for example, creating the GUI, getting the input through it, storing etc... once you do that, you should have a clearer idea of what you need help on and I (as well as other people on this site) could be of more help). |
|
|
|
|
![](images/spacer.gif) |
geoking
|
Posted: Wed Jan 07, 2009 5:24 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
ya itz pretty annoying..
but u gota do wat u gota do (to pass,,,,)
anyways thanx for the advice:) |
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Wed Jan 07, 2009 6:32 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
Does it have to be able to do multiple-operation calculations, like "4 * 6 + 9"? Does it have to follow order of operations?
If those are left out it would be pretty easy. |
|
|
|
|
![](images/spacer.gif) |
geoking
|
Posted: Wed Jan 07, 2009 10:40 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
hi!
thanx for replying.
no it doesn't have to do either of the two.. but it should accept multiple numbers like "48546 +1002" up to eight numbers:)
thnx for ur help |
|
|
|
|
![](images/spacer.gif) |
syntax_error
![](http://compsci.ca/v3/uploads/user_avatars/196798963948cf16794b6e5.jpg)
|
Posted: Wed Jan 07, 2009 10:57 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
You should think if you want to create a button type interface, if so make your own using mouse.where. If it is text entered like google and out puts answers the latter is simpler and very basic string handling. |
|
|
|
|
![](images/spacer.gif) |
geoking
|
Posted: Thu Jan 08, 2009 4:28 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
hey!
thanx for replying.
we have to input the numbers using 'button" commands...
i have been workin on a flow chart but im not done yet |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Jan 08, 2009 4:56 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
since you don't have to follow the order of operations, you only need to worry about keeping a current total and doing a single operation to it. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
YOYOHOHO
|
Posted: Thu Jan 08, 2009 6:38 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
LMAO, who is this XD,
and mis gregry for help... XD |
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Thu Jan 08, 2009 7:00 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
YOYOHOHO, spam is not appreciated or within the rules on this site. On Compsci.ca, you are expected to post with substance, which includes spell & grammar checking and only posting what is actually important. If you want to talk to someone without reference to the topic, keep it to private messages. |
|
|
|
|
![](images/spacer.gif) |
implosion
|
Posted: Thu Jan 08, 2009 8:06 pm Post subject: Re: HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
for your user interface i'd suggest you make your layout in Adobe Photoshop, then just load it in turing and use the Mouse.Where command, (not sure if thats what its exactly called) and then most of your code would be if statements. Oh and for each operation / number have it in a box, that way it'd be easier to put your boundaries for the mouse to click on |
|
|
|
|
![](images/spacer.gif) |
Euphoracle
![](http://compsci.ca/v3/uploads/user_avatars/11170373664bf5f25f636f1.png)
|
Posted: Thu Jan 08, 2009 9:59 pm Post subject: Re: HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
implosion @ Thu Jan 08, 2009 8:06 pm wrote: for your user interface i'd suggest you make your layout in Adobe Photoshop, then just load it in turing and use the Mouse.Where command, (not sure if thats what its exactly called) and then most of your code would be if statements. Oh and for each operation / number have it in a box, that way it'd be easier to put your boundaries for the mouse to click on
You can't animate button pressing very easily, in that case, so it'll be difficult to give good user-feedback. However, creating button backdrops, one for regular, one for mouseover, and one for pressed would be a great idea for a visually appealing, and functional, interface.
Or you can do it all in code. |
|
|
|
|
![](images/spacer.gif) |
NotAHax
|
Posted: Thu Jan 08, 2009 10:17 pm Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
Lol, this is funny because YOYOHOHO, geoking and I must know each other in real life because we all received the exact same assignment. From the same teacher, teaching the same course, offered in grade 10. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Jan 08, 2009 10:22 pm Post subject: Re: HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
implosion @ Thu Jan 08, 2009 8:06 pm wrote: for your user interface i'd suggest you make your layout in Adobe Photoshop
That's a pretty bad idea for a variety of reasons. As Euphoracle pointed out, you can't really animate a static image. Further, the layout and functionality becomes locked in, to that static image. You wouldn't be able to easily add/remove/edit/move a button.
For a visually appealing interface, it might be a good idea to draw a couple of states of a generic button, and then draw in the text with Font.Draw. Though really, this should be worried about after the core software is done. Having a pretty photoshop layout and no working code is utterly useless, especially in a context of a school assignment. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
implosion
|
Posted: Fri Jan 09, 2009 12:21 am Post subject: Re: HOW TO MAKE A CALCULATOR ON TURING-plz help |
|
|
oh sorry, i didn't see that it was said that you had to use a button command. I was thinking that programming wise it would be easier just to import a picture as the background and then depending on where the mouse is and clicked a certain action would be performed. |
|
|
|
|
![](images/spacer.gif) |
|
|