The best way to get help with problems like this is to explain what answer you expected to get and what answer you actually got, in addition to relevant code. I'm going to guess that the output when you ran the program was something like 0/1 and junk output of some type. If so then note that the constructor you've declared doesn't initialize d or x before you try to use them.

By the way why you are using d and x instead of deniminator and numerator when displaying the object as type double.

Basically the program is just supposed to do basic arithmetic operations (addition, subtraction, multiplication, and division) using two fractions that are input by the user. I run it, the command prompt comes up, and somehow it prints out a '0' at the end of the cout string, even though there isn't one in the code. I did initialize the numerator and denominator to 0 and 1 respectively, but when I take those values out, I get a 'C2512, no appropriate default constructor' error. I know that I need to somehow call the member functions into the main function and tell it to do the fore-mentioned calculations, but I'm not sure how to.

Actually, given that you are not initializing c , this is pretty much what you would expect to see, as the result of dividing 0 by 1.0 is in fact zero.

In order to get a different value for c , you'll want to initialize it when you declare it:

Rational c(3, 4); // three-fourths

Or else, add setters to change the numerator and denominator after the fact.

Actually, you should be getting NaN (Not a Number), for the second part, as you never initialize d and x at all. Those two instance variables are redundant, in any case; you want to remove those two variables outright, and divide numerator by denominator :

Thanks for the previous responses. At this point, all I need to do is make some adjustments to the code to allow the user to enter two rational numbers. Everything else is running just fine. My professor said something about overloading the operators, as the user will be entering two rational numbers. I've gone over the subject, but I'm not sure how to covert that to the actual changes that I need to make to the code. Any ideas? Thanks in advance.

As an aside, why did you change your main() from int main() to void main() ? The correct form is int main() ; strictly speaking, void main() shouldn't compile at all.

Also, I would separate the class definition and implementation into separate files from the main() function, just to keep the whole thing cleaner. Note that you generally want to avoid using the using namespace std; directive in header and class implementation files, especially if you are going to implement an overloaded operator<< or operator>> for I/O.

Assuming we're talking about overloading the input and output functions, the general approach is to make a friend function which takes a stream of the appropriate type, and an object of the class to be printed. You would need to add the following declaration to your class:

friend std::ostream& operator<<(std::ostream& os, Rational& r);

You would then implement the function outside of the class, but because it is a friend , it would have access to the internals of the class. The output function is actually quite close to what you already have for you printRational() method:

Note that I explicitly referred to the std namespace when declaring the ostream& objects; this is because (as explained here in mind-numbing detail) it defaults to assuming that the class ostream& is in the global namespace otherwise, wheras you actually want the class that is in the std namespace. This is why I had advised against the using directive earlier.

Overloading the istream operator>> is similar, but a bit more complicated, as you will want to read in the '/' but ignore it; using the ignore() method is probably the best way to do this.

Also, you need to be careful not to allow a zero denominator. Usually, you would throw an exception in this case, but I'm guessing your course hasn't covered exceptions yet. I'm not sure what to recommend, other than just making sure that the denominator is in a valid state when the function ends.