#include class Fraction { public: Fraction(); Fraction(int n); Fraction(int n, int d); void SetNumerator(int n); void SetDenominator(int d); double ToDecimal(); private: int numer; int denom; }; Fraction::Fraction() { numer = 0; denom = 1; } Fraction::Fraction(int n) { numer = n; denom = 1; } Fraction::Fraction(int n, int d) { numer = n; denom = d; } void Fraction::SetNumerator(int n) { numer = n; /* notice we are accessing private member numer here. */ } void Fraction::SetDenominator(int d) { if(d != 0) denom = d; else denom = 1; } double Fraction::ToDecimal() { return (double) numer / denom; /* integer division */ } int main() { Fraction F; /* F.numer = 1; */ F.SetNumerator(1); F.SetDenominator(2); std::cout<<"Decimal: "<