Question: pls write a program in c++. for; --> Design a new class to represent a fraction (a ration of two integer values) 15 22 -
pls write a program in c++.
for; -->

Design a new class to represent a fraction (a ration of two integer values) 15 22 - - Numerator Denominator The data members of the class Fraction are two integers top and bottom, denoting the numerator and denominator, respectively class Fraction private: // Numerator // Denominator 4 int top; int bottom; public: Part 1: Fundamental requirements for the class Fraction. 1. Fractional numbers can be declared with both a numerator and denominator, or simple numerator: Fraction a; Fraction b(3,4); Fraction c(5); // represents 0/1 // represents 3/4 // represents 5/1 2. Fractions should be able to act just like other numbers. Add, subtract, multiple and divide; Compare based on values; Input and output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
