1. Engineering
  2. Computer Science
  3. please please please hurry this program should be written in...

Question: please please please hurry this program should be written in...

Question details
Please please please hurry! This program should be written in C++ using the prompt below and the question below that. Thank you
The goal of assignment 2 is to reinforce implementation of ADT concepts in C++. Specifically, the assignment is to do problem 2.15 on pages 94 of the text. Your code must implement the style guidelines of the author (preconditions, postconditions, etc.). Your solution needs to have 3 separate files. Please name the files as following: rational.h - Class definition or header file rational.cpp- Implementation file that contains all implemented functions of the rational class rational _test.cpp-test file to test the rational class. Create at least 2 objects of the rational class and test ALL functions defined in the class. Make sure your output has proper labels for inputs as well as output. If you are working on your local machines, please make sure that your final code can be compiled and executed on the cloudland server.
usshall distribution. tha ba gr Write a class for rational numbers. Each object in the class should have two integer values that define the rational number: the numerator and the denominator. For example, the fraction 5/6 would have a denominator of 5 and a nu- merator of 6. Include a constructor with two argu- ments that can be used to set the numerator and
denominator (forbidding zero in the denominator). Provide default values of zero for the numerator and one for the denominator. be nu Overload the input and output operators. Num- bers are to be read and written in the form 1/2, 32/15, 300/401, and so forth. Note that the numer- ator, the denominator, or both may contain a minus sign, so -1/2, 32/-15, and -300/-401 are possible. us 0. ar Include a function to normalize the values stored ti so that, after normalization, the denominator is pos-c itive and as small as possible. For example, after a normalization, 4/-8 would be represented the same i at ut Overload the usual arithmetic operators to pro- vide addition, subtraction, multiplication, and divi- sion of two rational numbers. Overload the usual comparison operations to allow comparison of two rational numbers. rs of Hints: Two rational numbers alb and c/d are equal if a*d equals c*b. For positive rational num- bers, alb is less than cld, provided a*d is less than c*b.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution