2 pe (ii) Write the following functions that create a RationalC: . Rational create rational(): Initialises the fraction
Posted: Sat May 14, 2022 2:57 pm
programm in c and cpp
2 pe (ii) Write the following functions that create a RationalC: . Rational create rational(): Initialises the fraction with • Rational create rational (int n): Initialises the fraction with 다. Rational create rational(int n, int d): Initialises the fraction with . 2 pol . ii) Write a class RationalCpp that contains numerator and denominator as private attributes. RationalCpp should have three public constructors (similarly to : • RationalCpp(): Initialises the fraction with RationalCpp(int n): Initialises the fraction with • RationalCpp(int n, int d): Initialises the fraction with Moreover, RationalCpp should have public methods that allow reading and setting the nume ator and denominator. Reading the numerator or denominator of constant objects should be possible.
2 pe (ii) Write the following functions that create a RationalC: . Rational create rational(): Initialises the fraction with • Rational create rational (int n): Initialises the fraction with 다. Rational create rational(int n, int d): Initialises the fraction with . 2 pol . ii) Write a class RationalCpp that contains numerator and denominator as private attributes. RationalCpp should have three public constructors (similarly to : • RationalCpp(): Initialises the fraction with RationalCpp(int n): Initialises the fraction with • RationalCpp(int n, int d): Initialises the fraction with Moreover, RationalCpp should have public methods that allow reading and setting the nume ator and denominator. Reading the numerator or denominator of constant objects should be possible.