Answered You can hire a professional tutor to get the answer.

QUESTION

Fraction Class Implement a class called Fraction . The class's purpose is to store a representation of a fraction . Fraction's numerator and...

mplement a class called Fraction. The class's purpose is to store a representation of a

fraction. Fraction's numerator and denominator

values stored in class fields as integers.

If the fraction is negative, the negative sign is recorded as part of numerator.

  • Attachment 1
  • Attachment 2
  • Attachment 3
  • Attachment 4
  • Attachment 5
  • Attachment 6
Fraction ClassImplement a class called Fraction . The class's purpose is to store a representation of afraction . Fraction's numerator and denominator values stored in class fields as integers . Ifthe fraction is negative , the negative sign is recorded as part of numerator . The fraction isalways stored in its simplest form .The class should have the following methods "Constructor I that accepts two integer numbers , numerator and denominator .Denominator must not be a 0 . If a O passed as a denominator , allIllegalArgument. Except ion must be thrown by theconstructor .Constructor must call simplify !'; method to simplify fraction after*setting the fields .`Constructor 2 accepts three integer numbers to represent mixed fraction : first*number is the whole part the other two are numerator and denominator . Internally*the fraction is still stored as numerator and denominator only .` Denominator must not be a O . If a O passed as a denominator , allII legal Argument E X Ception must be thrown by the constructor .Example :`Fraction I1 = now Fraction ( 25 , 3, 51: / /' mixedFraction 25 and 3/ 5)OConstructor must call simplify , method to simplify fraction after setting*the fields .
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question