Question: Write a program in Ct+ with the following requirements: - Create the class Fraction (this class will have two member variables of type int): a)
Write a program in Ct+ with the following requirements: - Create the class "Fraction" (this class will have two member variables of type int): a) The class must have 3 constructors: default, with parameters using initializer list, and the copy constructor. b) The class should overload the assignment (=) operator. c) The class should have "get" and "set" methods for the member variables. d) The class should have the functionalities: addition, subtraction, multiplication, and division. e) The class should have the method print() that prints the fraction. f) The class should have the method simplify() which will reduce the resulting fraction to the lowest terms
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
