Create a client program that uses all

Assignment Help JAVA Programming
Reference no: EM131587654

Inheritance Programs

Part 1
Number 3 on page 719 which creates a Point class with 2 instance variables; the xCoordinate and yCoordinate. It should have a default constructor and a values constructor. Also include a set method that sets both attributes, a get method for each attribute, and a method that redefines toString() to print the attributes as follows.
point: (x, y)

Part 2
Do number 4 on page 719 which creates a Circle class that extends the Point class above. It adds the radius, circumference, and area instance variables. It should have a default constructor and a values constructor (circumference and area will be 0.0). Include a set method that sets the coordinates and radius attributes, get methods that get each of the 3 new attributes, and a method that redefines toString() to print all attributes. Also, include methods to calculate the circumference and area of the circle. Use pie = 3.141593. Make sure your methods don't repeat the code already written in the Point class.
Circumference = 2pier
Area = pier2

Part 3
Do number 5 on page 719 which creates a Cylinder class that extends the Circle class above. It adds the height, surfaceArea, and volume instance variables. It should have a default constructor and a values constructor (circumference and circleArea will be calculated from the Circle class, surfaceArea and volume will be 0.0). Include a set method for the center point coordinates, radius, height, circumference, and circleArea attributes (circumference and circleArea will be calculated from the Circle class), get methods that get each of the 3 new attributes, and a method that redefines toString() to print all attributes. Also, include methods to calculate the surfaceArea and volume of the cylinder. Make sure your methods don't repeat the code already written in the Circle class.
surfaceArea = 2 * circleArea + circleCircumference * cylinderHeight
volume = circleArea * cylinderHeight
Hints:
1.In the values constructor and the set method you'll need to call the methods to calculate circumference and area so that they have values to use in calculating the surface area and volume.
2.The methods in the Circle class to calculate circumference and area will need to return those values for use in the Cylinder class.

Part 4
Create a client program that uses all 3 of the classes created above. Make it do the following in this order:
1.Instantiate point1 with the default constructor.
2. Instantiate point2 with the values constructor.
3. Use the Point class print method to print point1 and point2.
4. Call the set method to set the x and y coordinates for point1.
5. Use the get methods to get the attributes for point1 and print them in the client (not with the print method).
6. Instantiate circle1 with the default constructor.
7. Instantiate circle2 with the values constructor.
8. Call the methods to calculate the circumference and area for circle2.
9. Use the Circle class print method to print attributes for circle1 and circle2.
10. Use the set method to set the coordinates and radius for circle1.
11. Call the methods to calculate the circumference and area for circle1.
12. Use the get methods to get the attributes for circle1 and print them in the client (not with the print method).
13. Instantiate cylinder1 with the default constructor.
14. Instantiate cylinder2 with the values constructor.
15. Call the methods to calculate the surfaceArea and volume for cylinder2.
16. Use the Cylinder class print method to print the attributes for cylinder1 and cylinder2
17. Call the set method to set the attributes for cylinder1.
18. Call the methods to calculate the surfaceArea and volume for cylinder1.
19.Use the get methods to get the attributes for cylinder1 and print them in the client (not with the print method).

Reference no: EM131587654

Questions Cloud

Find quantities of capital that minimize total cost to firm : Application exercise. Suppose that the total cost, C, of producing q0 = 100 units of output by a firm is given by the function C = f (k,l) = 0.2k + 5l.
How did media shape your perspective of product advertised : What was the experience like and how did it shape your perspective of the product advertised? Can advertisers go too far in the realm of "shock advertising"?
State the approximate worst-case running time : If you are unsure of one of the calls into the Java Platform APIs, think about how the method might be implemented, and/or read its documentation.
What is your vision of a fair and just society : What is your vision of a fair and just society. How close does the United States fit this vision
Create a client program that uses all : Create a client program that uses all 3 of the classes created above - Use the get methods to get the attributes for cylinder1 and print them in the client
What are three types of opportunities for sharing a sound : What are three types of opportunities for sharing a sound basis for diversification or vertical integration? Give example of each from companies you have read.
Purpose of creating a template : What is the purpose of creating a template? Describe the features of a professional presentation. What screen features would make the presentation.
Prepare the journal entry to record the exchange : Flounder Company traded a used welding machine for office equipment with an estimated fair value of $6,900. Prepare the journal entry to record the exchange
Twos complement integers : Add the following 16 bit twos complement integers: 4555 + 3242. State whether there is a carry and/or an overflow and give the final result in base 10 format.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd