![]() |
|
#1
|
|||
|
|||
Fraction calculations not displayingThe goal of my program is to enter 2 fractions and display the results of calculations on the 2 fractions. When I run the program I am able to enter the two fractions, but am unable to view the results of the calculations. I've looked at some similar code, but they were above my skill level. I don't know what I'm doing wrong. I've added a few comments in the code. Thanks in advance for any help.
CPP / C++ / C Code:
Last edited by LuciWiz : 02-May-2006 at 08:23.
Reason: Please insert your C++ code between [c++] & [/c++] tags
|
|||
|
#2
|
|||
|
|||
Re: Fraction calculations not displayingQuote:
This might be a good start. CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: Fraction calculations not displayingYou're right I was trying to do too much at once. When you simplified it for me I noticed I forgot a Fraction.print() in the Main function. Or in this case Fraction.add(), Fraction.subtract(), etc. since I will print the results after each calculation with:
Code:
|
|
#4
|
|||
|
|||
Re: Fraction calculations not displayingYes it is not as overwhelming when you break the task into little pieces.
CPP / C++ / C Code:
You might want to take a look at adding a constructor to your class. It would take the place of this. CPP / C++ / C Code:
|
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| overloading operators in a class. | fevershark | C++ Forum | 11 | 22-Feb-2006 20:34 |
| fraction class program | fevershark | C++ Forum | 7 | 31-Jan-2006 12:12 |
| Interface for opening and displaying text file | ladyscarlet99 | MS Visual C++ / MFC Forum | 0 | 29-Sep-2005 03:34 |
| Non-member method needs info from class... how? | Elsydeon | C++ Forum | 3 | 19-Sep-2005 16:13 |
| opening files and displaying text | pin215 | C++ Forum | 7 | 21-Feb-2004 22:27 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The