creating an abstract class shape i

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadlines.


Order a Similar Paper Order a Different Paper

Option #1: Creating an Abstract Class Shape I

Create an abstract class “Shape” with the following specifications:

  1. An abstract method “surface_area ()” of return type double
  2. An abstract method “volume()” of return type double

Put your code in a Java source file named “Shape.java.”

I.

Create a class “Sphere” that extends the Shape class with the following specifications:

  1. Attributes:
    • Radius
  1. Constructor:
    • Implement a parameterized constructor needed to initialize the data.
  1. toString:
    • Implement a “toString” method that prints out the surface area and volume.

Implement methods to compute the surface area and volume.

II.

Create a class “Cylinder” that extends the Shape class with the following specifications:

  1. Attributes:
    • Radius, height – both of type double
  1. Constructor:
    • Implement a parameterized constructor to initialize the data.
  1. toString:
    • Implement a “toString” method that prints out the surface area and volume.

Implement methods to compute the surface area and volume.

III.

Create a class “Cone” that extends the Shape class with the following specifications:

  1. Attributes:
    • Radius, height – both of type double
  1. Constructor:
    • Implement a parameterized constructor to initialize the data.
  1. toString:
    • Implement a “toString” method that prints out the surface area and volume.

Implement methods to compute the surface area and volume.

IV.

Create a driver class named “ShapeArray” with the following specifications:

  1. Instantiate one sphere.
  2. Instantiate one cylinder.
  3. Instantiate one cone.
  4. Store the class instances into an array named “shapeArray.”
  5. Loop through the array and print out the instance data of each object using the object instance’s “toString” method.

Show a Unified Modeling Language (UML) diagram of your project.

Condense your source files and UML diagram as a zipped folder and submit the zipped file as your critical thinking assignment (CTA).

please be eclipse java compatible*** original attached please

"Is this question part of your assignment? We can help"

ORDER NOW

Do you need help with this or a different assignment? We offer CONFIDENTIAL, ORIGINAL (Turnitin/LopesWrite/SafeAssign checks), and PRIVATE services using latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and PhD writers.

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper