In Progress

Java Fraction Program

The files must be called <LastNameFirstNameProg7.java>. (driver)

[url removed, login to view] (handles the fractional numbers)

Example: [url removed, login to view]

[url removed, login to view]

Ensure you include ALL files required to make your program compile and run.

I would like to see your .java files only.

Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter.

Basic Requirements

Write a driver and fraction class that performs addition, multiplication, prints the fraction, and prints as a double.

[url removed, login to view]

Provide a driver class, LastNameFirstNameProg7, that demonstrates this Fraction class. The driver class should contain this main method:

public static void main(String[] args)

{

Scanner stdIn = new Scanner([url removed, login to view]);

Fraction c, d, x; // Fraction objects

[url removed, login to view]("Enter numerator; then denominator.");

c = new Fraction([url removed, login to view](), [url removed, login to view]());

[url removed, login to view]();

[url removed, login to view]("Enter numerator; then denominator.");

d = new Fraction([url removed, login to view](), [url removed, login to view]());

[url removed, login to view]();

x = new Fraction(); // create a fraction for number 0

[url removed, login to view]("Sum:");

[url removed, login to view](c).add(d);

[url removed, login to view]();

[url removed, login to view]();

x = new Fraction(1, 1); // create a fraction for number 1

[url removed, login to view]("Product:");

[url removed, login to view](c).multiply(d);

[url removed, login to view]();

[url removed, login to view]();

[url removed, login to view]("Enter numerator; then denominator.");

x = new Fraction([url removed, login to view](), [url removed, login to view]());

[url removed, login to view]();

} // end main

Note that this demonstration driver does not call the accessor methods. That’s OK. Accessor methods are often implemented regardless of whether there’s an immediate need for them. That’s because they are very useful methods in general and providing them means that future code can use them when the need arises.

[url removed, login to view]

Write a Fraction class called [url removed, login to view] that implements these methods:

add ? This method receives a Fraction parameter and adds the parameter fraction to the calling object fraction.

multiply ? This method receives a Fraction parameter and multiplies the parameter fraction by the calling object fraction.

print ? This method prints the fraction using fraction notation (1/4, 21/14, etc.)

printAsDouble ? This method prints the fraction as a double ([url removed, login to view], 1.5, etc.)

Separate accessor methods for each instance variable in the Fraction class.

Sample Output

Enter numerator; then denominator.

5

8

5/8

Enter numerator; then denominator.

4

10

4/10

Sum:

82/80

[url removed, login to view]

Product:

20/80

[url removed, login to view]

Enter numerator; then denominator.

6

0

infinity

Skills: Java, Javascript, PHP, Software Architecture

See more: fraction java program, proper fraction program java, java program proper fraction, java double fraction, java fraction program, write fraction program java, java fraction, fraction java, fraction program java, print println java, first capital, coding program, sample coding java, php coding program, coding java, product demonstration, notation, java means, java code example, program output, java notation, proper letter, program sample, create java object, php string contain

About the Employer:
( 9 reviews ) San Antonio, United States

Project ID: #2535946

Awarded to:

it2051229

Hi, I'd like to do this project please.

$30 USD in 0 days
(210 Reviews)
6.3

5 freelancers are bidding on average $34 for this job

procoder898

Hi, I am expert at Java and can surely satisfy you. Please check your inbox,

$30 USD in 0 days
(94 Reviews)
6.3
abhishekmiet

Hello, an expert Java programmer here and ready to start.

$50 USD in 1 day
(18 Reviews)
4.6
swteam4

Hello, we are experts in Java and can complete this task within an hour. Kindly check PMB.

$30 USD in 0 days
(18 Reviews)
4.4
HadiAsiaie

I can help you

$30 USD in 0 days
(1 Review)
3.3