III. Again, create a Rational class for storing fractions in arithmetic. This time use a private C structure data member
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
III. Again, create a Rational class for storing fractions in arithmetic. This time use a private C structure data member
III. Again, create a Rational class for storing fractions in arithmetic. This time use a private C structure data member that integrates two integer variables int numerator and int denominator to hold the two parts of a fraction. (25%, a:5, b:10, c:10) a) Please create a C structure Rational with two integer statiable fields for the numerator and denominator of a fraction. b) Please create a class Rational Class that has a data member of Rational structure. Define a constructor that accepts two arguments, e.g. 3 and 4 and uses member initializer syntax to set the data fields of the fields of the structure data member. c) Overload the multiply operator (*) to multiply two Rational objects and returns the result object.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!