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

Username:   Password: 
 RegisterRegister   
 Need Basic help on a turing program!!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tubby_Kat




PostPosted: Mon Apr 06, 2009 8:24 pm   Post subject: Need Basic help on a turing program!!!

Can anyone explain to me how to make function and procedures that could be relavant to this problem? Embarassed I understand how to make fraction and add them together, but I'm having troubles with the function concept... : Write a program that will perform the basic mathematical operations (add, subtract, multiply, divide) on input values that are fractions (numerator and denominator), and will output a fractional answer.

Also how can you express your final answers as reduced fractions and allow each fraction to be entered as a single input (allowing the user can type "5 / 3" as their first fraction).

Thanks for reading my post! I know you guys can help!!

Smile
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Apr 06, 2009 8:51 pm   Post subject: RE:Need Basic help on a turing program!!!

There are tutorials on functions available via Turing Walkthrough.

Reduction of fractions requires factorization.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Tubby_Kat




PostPosted: Mon Apr 06, 2009 9:03 pm   Post subject: Re: Need Basic help on a turing program!!!

factorization? how do I use that with function. I know what it is and how to use it with smaller programs, but how do I do it with fractions? And reducing those fraction? Thinking
Tony




PostPosted: Mon Apr 06, 2009 9:10 pm   Post subject: RE:Need Basic help on a turing program!!!

ehh... integer factorization, or prime decomposition, whichever name you know the concept by.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Tubby_Kat




PostPosted: Mon Apr 06, 2009 9:27 pm   Post subject: Re: Need Basic help on a turing program!!!

Okay...but how am I suppose to use that into a function? Can you just explain how the function show look like, and how I'm suppose to write the integer factorization in turing code? >____< (just in words)
Tony




PostPosted: Mon Apr 06, 2009 9:46 pm   Post subject: RE:Need Basic help on a turing program!!!

do you know how to reduce fractions on paper?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Tubby_Kat




PostPosted: Tue Apr 07, 2009 5:33 pm   Post subject: Re: Need Basic help on a turing program!!!

Yes, I do. But how am I suppose to convert that into code? And with a function!
andrew.




PostPosted: Tue Apr 07, 2009 7:39 pm   Post subject: RE:Need Basic help on a turing program!!!

Try writing the steps down on paper. Then write that in Turing. After that, it should be simple to turn it into a function.
Sponsor
Sponsor
Sponsor
sponsor
Dusk Eagle




PostPosted: Tue Apr 07, 2009 11:24 pm   Post subject: Re: Need Basic help on a turing program!!!

Basically what Tony and andrew are saying is that there isn't one easy built-in way to solve a problem. The point of this assignment is to get you to think through how to do this problem yourself, and that's why no one is helping you with the actual logic. Similar to what andrew said, write a way of solving the problem out step-by-step on paper, then translate those instructions one at a time into Turing. That should make it far easier to solve this problem.
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  [ 9 Posts ]
Jump to:   


Style:  
Search: