Đã Đóng

[url removed, login to view]

Directions

Points

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.

4

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.

16

[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 (0.25, 1.5, etc.)

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

56

Upload your page to the Dropbox.

NOTE: Complete your activity and submit it to the Dropbox in eCollege

4

Total Points

80

Sample Output

Enter numerator; then denominator.

5

8

5/8

Enter numerator; then denominator.

4

10

4/10

Sum:

82/80

1.025

Product:

20/80

0.25

Enter numerator; then denominator.

6

0

infinity

Kỹ năng: Hỗ trợ khách hàng, Nhập liệu, Xử lí dữ liệu, Trợ lí trực tuyến

Xem thêm: string processing in c, print println java, new in java 1.5, java 1.5 for each, first class objects in java, first capital, ecollege, double data entry method, 16 handles, write fraction java driver class, lastnamefirstnameprog7, sample coding in java, coding in java, VOID, requirements dropbox, product demonstration, notation, Basic java, java means, fraction program java, java code example, java notation, java double fraction, proper letter, create java object

Về Bên Thuê:
( 7 nhận xét ) not disclosed, United States

Mã Dự Án: #1608871

6 freelancer đang chào giá trung bình $30 cho công việc này

samitXI

Please check your inbox. Thanks

$30 USD trong 1 ngày
(27 Đánh Giá)
5.2
dobreiiita

Hi, I am JAVA expert and can surely help you here, Please check your inbox,Thanks

$30 USD trong 1 ngày
(13 Đánh Giá)
3.9
Lurz05

Note: we have no any work pls don't a dd for work. !!!!!!Hotmail Account Available!!!!!! All Account must fresh & quality 72 hours replacement time all account creating time using USA female first name & Thêm

$30 USD trong 1 ngày
(0 Đánh Giá)
0.0
monumichael

HI, Experienced java developer for your service. Please have at my review comments to see the quality of my works. Kindly approve my bid. Regards

$30 USD trong 1 ngày
(0 Đánh Giá)
0.0
egypro

please check PM

$30 USD trong 0 ngày
(0 Đánh Giá)
0.0
mkeerthi

Hi, I am ready to start. Please check PM for details. Thanks

$30 USD trong 1 ngày
(0 Đánh Giá)
0.0