Question: Use c++ Write a rational number class. For now, we will use member functions add, sub, mul, div and less that each carry out the
Use c++ Write a rational number class. For now, we will use member functions add, sub, mul, div and less that each carry out the operations +,, *,/, and <. for example a will be written as a.add and acb a.less the rational number is composed of two integers with division indicated not carried out it only indicated. so in represented by int values numerator denominator. constructor to create objects any legal value have parameters. since every also like or you should single parameter. member functions add sub mul div return function less bool value. these do operation suggested name. write friend addfraction parameters which are fraction obiect main that thoroughly tests your class implementation following formulas useful defining functions: c>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
