Can somebody help me with this C++ program. Plz dont use java. Thanks
An algorithm that accepts the numerator and denominator of a fraction as input and produces as output the numerator and denominator of that fraction written in lowest terms.
#include
using namespace std; class Fraction { public: void output1() { double decimal = static_cast (n) / d; cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(4); cout << \"The fraction as a decimal is : \" << decimal << \".\ \"; } void output2() { int temp, temp2, temp3; while (d != 0) { temp = n % d; temp2 = n; temp3 = d; n = d; d = temp; } cout << \"The lowest term of the fraction is : \" << (temp3 / n) << \"/\" << (temp2 / n) << \".\" << endl; } void input() { cout << \"Enter a integer for the numerator: \"; cin >> n; cout << \"Enter a integer for the denominator: \"; cin >> d; } private: int n; int d; }; int main() { Fraction number1; number1.input(); number1.output1(); number1.output2(); return 0; }