Page 1 of 1

In JAVA: Given is the interface fractional for fractions with numerator and denominator on which simple arithmetic opera

Posted: Fri May 20, 2022 11:43 am
by answerhappygod
In JAVA:
Given is the interface fractional for fractions with numerator
and denominator on which simple arithmetic operations are
possible.
In Java Given Is The Interface Fractional For Fractions With Numerator And Denominator On Which Simple Arithmetic Opera 1
In Java Given Is The Interface Fractional For Fractions With Numerator And Denominator On Which Simple Arithmetic Opera 1 (64.02 KiB) Viewed 46 times
In the package app.exercise.algebra, implement an abstract class
BasisFraction that implements the Fractional
interface.
The class has no object or class variables.
Declare the following method for setting numerator and
denominator.
In Java Given Is The Interface Fractional For Fractions With Numerator And Denominator On Which Simple Arithmetic Opera 2
In Java Given Is The Interface Fractional For Fractions With Numerator And Denominator On Which Simple Arithmetic Opera 2 (7.36 KiB) Viewed 46 times
The methods add, sub, mul and div shall be
defined. Where negation for the implementation of sub and
reciprocal for the implementation of div is used.
package app. exercise. algebra; public interface Fractional { // get numerator long getN(); 1/ get denominator long getD(); // add operand to object void add (Fractional operand); // subtract operand from object void sub (Fractional operand); // multiply object by operand void mul (Fractional operand); // divide object by operand void div (Fractional operand); // new additive inverse object Fractional negation (); // new multiplicative inverse object Fractional reciprocal (); } }

protected abstract void setND (long numerator, long denominator)