# need help to do a Java program

Mar 22nd, 2015
DotaCN
Category:
Computer Science
Price: \$60 USD

Question description

Please review Chapter 8 and complete the following lab assignments.

Problem 5.1

In Chapter 8, the class Clock was designed to implement the time of day in a program. Certain application in addition to hours, minutes, and seconds might require you to store the time zone.

In this assignment, please do the following:

Implement class Clock - The detailed implementation source code for class Clock (Clock.java) can be found in the textbook (pages: 466-470).

Derive the class ExtClock from the class Clock by adding a data member to store the time zone. Add necessary methods and constructors to make the class functional. Also write the definitions of the methods and constructors.

Write a test program to test your program

(Hints: please look at the examples Class Rectangle and Class Box from pages 654-660; for testing this new derived class, please refer to Example 8-2 in Pages 470-471).

Problem 5.2

In the following problem, you will need to implement a superclass in step a) and then a subclass in step b).

Implement a superclass for the class Point. Here is the requirement. Write a A pint in the x-y plane is represented by its x-coordinate and y-coordiate. Design the class pointer that can store and process a point in the x-y plane. You should then perform operations on a point, such as showing the point, setting the coordinates of the point, printing the coordinates of the point, returning the x-coordinate, and returning the y-coordinate. Also write a program to test various operations on a point.

Develop a subclass – class Circle based on the class you develop in a). Here is the requirement: Every circle has a center and a radius. Given the center, we can ddetermine the circle’s area and circumference. Given the center, we can determine its position in the x-y plane. The center of a circle is a point in the x-y plane. Design the class Circle that can store the redius and center of the circle. Because the center is a point in the x-y plane and you design should derive the class Circle from the class Point you have done in step a). You should be able to perform the usual operations on a circle, such as setting a radium, printing radium, calculating and printing the area and circumference.

(Top Tutor) Daniel C.
(997)
School: UIUC

Studypool has helped 1,244,100 students

## Review from our student for this Answer

FratBro23
Mar 22nd, 2015
"Thank you, Thank you, for top quality work, this is your guy!!"

1821 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors