Unlike the rest of the labs where you started from scratch, this lab has been started for you. Please open and extract the attached project, and start from there.For this project, you will only be...

1 answer below »



Unlike the rest of the labs where you started from scratch, this lab has been started for you. Please open and extract the attached project, and start from there.




For this project, you will only be working on the Fraction class.




When you create a new fraction, you should pass it a numerator and denominator to assign immediately using a Constructor class.




Your class should have methods to allow you to add, subtract, multiply, and divide numbers to your fraction.
Using Method Overloading, you should be able to do these operations:




By sending an individual integer




By sending a numerator and denominator




By sending another fraction




That means you will have 3 add methods, 3 subtract methods, 3 multiply methods, and 3 divide methods.




Finally, your class should have a method that displays the fraction.




You do not need to do any additional work on the main program.




The Fraction class has been started for you. All 3 multiple methods are complete. You can review that for help on writing the other methods.




The 'shell' for all of the other methods has been step. You only need to code in the bodies of the methods.




If you do everything correctly, the output of the program based on what is currently in the main program should be:







Fraction 1 is now: 96/288








Fraction 2 is now: 2/8

















using System;
using System.Collections.Generic;
using System.Text;




namespace IT1050_Lab15
{
class Fraction
{
int numerator;
int denominator;




public Fraction(int numerator, int denominator)
{




}




public void Multiply(int numerator, int denominator)
{
this.numerator = this.numerator * numerator;
this.denominator = this.denominator * denominator;
}




public void Multiply(int wholeNumber)
{
this.numerator = this.numerator * wholeNumber;
}




public void Multiply(Fraction fraction)
{
this.numerator = this.numerator * fraction.numerator;
this.denominator = this.denominator * fraction.denominator;
}




public void Divide(int numerator, int denominator)
{




}




public void Divide(int wholeNumber)
{




}




public void Divide(Fraction fraction)
{




}




public void Add(int numerator, int denominator)
{




}




public void Add(int wholeNumber)
{




}




public void Add(Fraction fraction)
{




}




public void Subtract(int numerator, int denominator)
{




}




public void Subtract(int wholeNumber)
{




}




public void Subtract(Fraction fraction)
{




}




public string DisplayFraction()
{




}
}
}

Answered Same DayDec 15, 2022

Answer To: Unlike the rest of the labs where you started from scratch, this lab has been started for you....

Vikas answered on Dec 15 2022
30 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here