i need to create a class named rational, and i need to have the integer variables denominator and numerator in private. The i need to provide a constructor that enables an object of the class to be initialized when it is declared. then it says the constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. so 2/4 should be stored in the object as 1 in the numerator, and 2 in the denominator. heres what i have done so far, im really confused.
#include <iostream>
class rational {
public:
private:
int numerator;
int denominator;
}; // end of rational class
int main()
{
return 0;
}