Question
Your task in this homework assignment is to add three constructors to the Fraction class. The fraction class stores a numerator and denominator. Member functions
Your task in this homework assignment is to add three constructors to the Fraction class.
The fraction class stores a numerator and denominator. Member functions allow for retrieval of the
fraction as a double and another outputs the value in lowest terms.
## Solution Specifications
Your solution to this problem must meet the following criteria.
1. Write a default constructor that creates a fraction with the value of one.
2. Write a custom constructor that takes one integer as an argument to be used as the denominator.
3. Write a second custom constructor that takes two integer as arguments to be used as the numerator and denominator.
In C++ Programming language:
In main.cpp file:
In fraction.h file:
In fraction.cpp file:
#include "Fraction.h" #includeStep 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