Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

(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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago