question after you write code and output. what compiler did you used? how do you work on this problem, what was most challenging part
1. Create a class RationalNumber (fractions, see problem 10.8 p.490) with the following capabilities: a) Create a constructor that prevents 0 on the denominator in a fraction, reduces (or simplifies) fractions that are not in reduced form (lowest terms), and avoids negative denominators b) Overload the addition, subtraction, multiplication, and division operators for this class. c) Overload the relational < and > and equality operators for this class. Test all member functions and overloaded operators.
1. Create the numbers Numerator = 4, Denominator = 14 Numerator = 4, Denominator = 0 Numerator = 4, Denominator =-14 Numerator +-4, Denominator =-14 Numerator - 2, Denominator = 3 Test the constructor, overloded +, -, .7.<,>, <= >=, --, !
please answer this 1. Create a class RationalNumber (fractions, see problem 10.8 p.490) with the following capabilities: a) Create a constr
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am