Chat with us, powered by LiveChat DescriptionDefine a class for rational numbers. Please downl - Writeedu

DescriptionDefine a class for rational numbers. Please downl

DescriptionDefine a class for rational numbers. Please download the Test program and add your code for submission.A rational number is a number that can be represented as the quotient of two integers. For example, 1/2, 3/4, 64/2, and so forth are all rational numbers. (By 1/2, etc., we mean the everyday meaning of the fraction, not the integer division this expression would produce in a C++ program.) Represent rational numbers as two values of type int, one for the numerator and one for the denominator. Call the class Rational.Include:a constructor with two arguments that can be used to set themember variables of an object to any legitimate values.a constructor that has only a single parameter of type int; call this singleparameter whole_number and define the constructor so that the objectwill be initialized to the rational number whole_number/1.a default constructor that initializes an object to 0 (that is, to 0/1).Overload:the input and output operators >> and <<. Numbers are to beinput and output in the form 1/2, 15/32, 300/401, and so forth. Notethat the numerator, the denominator, or both may contain a minussign, so -1/2, 15/32, and -300/-401 are also possible inputs. all of the following operators so that they correctly apply to the typeRational: ==, <, <=, >, >=, +, -, *, and /. (Hints: Two rational numbers a/b and c/d are equal if a*d equalsc*b. If b and d are positive rational numbers, a/b is less than c/dprovided a*d is less than c*b. You should include a function to normalizethe values stored so that, after normalization, the denominatoris positive and the numerator and denominator are as smallas possible. For example, after normalization 4/-8 would be representedthe same as -1/2.)RequirementsDOWNLOAD TEST PROGRAM and add your code for this lab. Do not change any code that’s already inside the test program, but add your class member variables and function definition and implementationsFollow the ADT (Abstract Data Type) guideline to implement the required class.Comment well in your program and any functions you useTest Cases1/2, -1/2, 4, 0, -/12 (should cause error)Demo Welcome to the Rational World of Wonders!Please enter a rational number for this calculation:1/21/2 + 1/2 = 11/2 – 1/2 = 01/2 * 1/2 = 1/41/2 / 1/2 = 11/2 == 1/2 : true1/2 < 1/2 : false1/2 <= 1/2 : true1/2 > 1/2 : false1/2 >= 1/2 : true

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteEdu. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

Do you need help with this question?

Get assignment help from WriteEdu.com Paper Writing Website and forget about your problems.

WriteEdu provides custom & cheap essay writing 100% original, plagiarism free essays, assignments & dissertations.

With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.

Chat with us today! We are always waiting to answer all your questions.

Click here to Place your Order Now