Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(General math) a. Construct a class named Fractions containing two integer data members named num and denom, used to store the numerator and denominator of
(General math) a. Construct a class named Fractions containing two integer data members named num and denom, used to store the numerator and denominator of a fraction having the form num/denom. Your class should include a default constructor that initializes num and denom to 1 if there's no user initialization, and it must prohibit a 0 denominator value. In addition, create member functions for displaying an object's data values and overloaded operator functions for adding, subtracting, multiplying, and dividing two Fraction objects, as follows Addition: a/b + cid = (a * d + b *c)/(b * d) Subtraction: a/b-c/d = (a * d-b * c) / (b * d) Multiplication: a/b * c/d (a * c) / (b * d) Division: (a/b)/ (c/d) = (a * d) / (b * C) b. Include the class written for Exercise a in a working C++ program that tests each member function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started