Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 HOW TO MAKE A CALCULATOR ON TURING-plz help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
geoking




PostPosted: 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:)
Sponsor
Sponsor
Sponsor
sponsor
DanielG




PostPosted: 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).
geoking




PostPosted: Wed Jan 07, 2009 5:24 pm   Post subject: RE:HOW TO MAKE A CALCULATOR ON TURING-plz help

ya itz pretty annoying..Sad
but u gota do wat u gota do (to pass,,,,)

anyways thanx for the advice:)
Insectoid




PostPosted: 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.
geoking




PostPosted: 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
syntax_error




PostPosted: 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.
geoking




PostPosted: 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
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
YOYOHOHO




PostPosted: 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
Insectoid




PostPosted: 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.
implosion




PostPosted: 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
Euphoracle




PostPosted: 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.
NotAHax




PostPosted: 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.
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
implosion




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 15 Posts ]
Jump to:   


Style:  
Search: