Question: Write a fraction class in c++. Will need the header and cpp files. Requirements: The class must have 3 types of constructors covered in lecture

Write a fraction class in c++.

Will need the header and cpp files.

Requirements:

The class must have 3 types of constructors covered in lecture 1: default, overloaded with initializer list, copy constructor

You must overload the assignment operator.

You must declare the overloaded output operator as a friend rather than part of the class

The Fraction class should implement addition, subtraction, multiplication, division and simplify operations.

Write a main function in a separate file to test each functionality and show that they work.

Thank You.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!