Question: This is in C++, technically doesn't need to be in Visual Studios, but please make sure to include the different files Using Microsoft Visual Studio,

This is in C++, technically doesn't need to be in Visual Studios, but please make sure to include the different files

This is in C++, technically doesn't need to be in Visual Studios,

Using Microsoft Visual Studio, write a program that includes a class called Rational for performing arithmetic on fractions. The Rational constructor should store a numerator and a denominator. The class should contain the following public member functions: - void Rational: :add (int n, int d) - Adds a fraction to the current fraction - void Rational: :sub (int n, int d) - Subtracts a fraction from the current fraction - void Rational: :mul (int n, int d) - Multiplies the current fraction by a new fraction - void Rational: :div(int n, int d) - Divides the current fraction by a new fraction The results of all arithmetic operations overwrite the previous values. Fractions should always be represented in reduced form. The main () function should ask for an initial numerator and denominator, then enter a menudriven loop where the various arithmetic operations can be performed. Use a try/catch block to check for illegal menu selections. Assume a well-behaved user that never enters 0 for a numerator or a denominator. Submit a .zip file to Canvas that contains three files: main.cpp, rational.cpp, and rational.h. Example Enter numerator: 4 Enter denominator: 6 reaction reduces to 2/3 1. Add a rational 2. Subtract a rational - Multiply by a pational 7. Divide by a rational - Exit Enter selection: 1 Enter numerator: 3 Enter denominator: 4 17/12 - Add a rational .. Subtract a rational 3. Multiply by a rational 7. Divide by a rational 9. Exit Enter selection

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!