Question: In preparation for the first project, you will develop a simple C++ class that allows us to represent rational numbers without the rounding errors that

In preparation for the first project, you will develop a simple C++ class that allows us to represent rational numbers without the rounding errors that are inherent in floating point numbers. Rational numbers are made up of an integer numerator and an integer denominator. Rational numbers can be positive or negative and when displayed shall always show the minus sign before the fraction, e.g. -1/2. Project Requirements: Your application must function as described below: 1. You must create a Makefile with a rule called main. i. The main rule must create an executable file, also called main. ii. Running the executable shall be accomplished by typing ./main at the command prompt. 2. Your main program should be very simple. It should read two integers in from the user (first the numerator, then the denominator) and output the simplified fraction for those values. i. For example if the input is 3 followed by -6, then your program would output -1/2 . 3. If the denominator, after simplifying the fraction is 1, simply output the numerator, e.g. 5/1 should output as 5. 4. If the denominator is zero, output NaN . This is a common symbol that means "not a number" since dividing by zero is not allowed in mathematics
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
