My program is supposed to have a Fraction class that can add two fractions and be able to display an object's data values. I'm thinking that I should have a different manner of allowing the two fractions to be entered, but I'm not really sure how to go about it. Any suggestions?
The more preferable way for this to work would be so that in main(), you first input the numerator and denominator to the first fractions class. Those would then be put into the actual class via a constructor. Then repeat with a second, add the two, and display the results (preferably with a display command other than accessing the elements directly, but either works).
Yes, and they will remain as such. The way I proposed simply initializes them via constructor versus using a function within the actual fractions class as to add two fractions (which is a misnomer anyway since it would only make sense to add two fractions as two different classes using +, not actually requiring any input). Both are still data members, but they way they are assigned is through main, not a function within Fractions. Besides, in regards to object-oriented programming, it makes more sense.
Think of it this way- is the Fractions class supposed to act as a de-facto fraction operation menu, or is each object of the Fractions class supposed to act as a fraction with a numerator and denominator that can be added, subtracted, multiplied and divided by one-another?