Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please HELP!!! please read the instructions given and help in filling according to the blank spaces *The calculated score will be located at the bottom

please HELP!!! please read the instructions given and help in filling according to the blank spaces image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
*The calculated score will be located at the bottom of your submission in the form of (for example) "5/5 = 100%", "4/5 = 80%", "3/5 = 60%", etc. IF YOU DO NOT obtain 100%, I encourage you to reach out for help on the Problem & Solutions Blog with your error messages so others can help. You can also view the "Common Code Check Errors" document located in iCollege. Please make sure you have viewed the "How to Use Code Check" video before starting. UML Diagram We will be writing an abstract "superclass" called CircularShapeWith Height.java and two "subclasses", Cylinder.java and CircularCone.java. UML Diagram PART 1 - Writing an abstract "superclass": CircularShapeWith Height.java This class will model an abstract "superclass" of a generic circular shape (such as a cone or cylinder) that has a radius and a height. The reason for making this class abstract is that we do not want to create objects for our "generic" shape. We want to create objects from our concrete classes, Circular Cone and Cylinder. Instructions for Part 1: Please find the Code Check page for this project: Chapter 9 Project Using your IDE (jGrasp, Eclipse, other), create a new project folder called Circular Shape Inside this project folder, create a class file named CircularShapeWith Height.java **Note: This is an abstract class (see Special Topic 9.3 p. 456-557), so we will need to declare the class as "public abstract class CircularShapeWith Height". Write the Class comment describing the class and @author and @version tags Declare and initialize 2 instance variables for: The radius as type double The height as type double Remember to declare them "private" instead of "public". Also, please make sure to use the "this" keyword anytime you use your instance variables after declaring them. Create a Constructor that takes a radius and height as parameters. Inside the constructor, initialize the instance variables with the parameters of the constructor Write an accessor method, getDiameter(), that takes no parameters and returns the diameter of a circle as type double Inside this method, calculate the diameter and return from the method Write an accessor method getRadius(), that takes no parameters and returns the radius of the circular object Write an accessor method getHeight(), that takes no parameters and returns the height of the circular object Write an accessor method getCross SectionArea(), that takes no parameters and returns the cross section area of the circular object (hint: this is just the area of a circle) Write an accessor method getCross SectionPerimeter(), that takes no parameters and returns the cross section perimeter of the circular object (hint: this is just the perimeter of a circle) **Make sure you have commented the class, constructor, and all methods and included @param or @return tags as needed! PART 2 - writing a "subclass": CircularCone.java This class will model a Circular cone 3D shape. Instructions for Part 2: In the same project folder from Part I, create a new class file named CircularCone.java that will inherit from the CircularShape With Height abstract class (hint: you need a keyword here - p. 444). Write the Class comment and @author and @version tags Write a constructor that takes radius and height as parameters Inside the constructor, call the "superclass" constructor and pass the parameters (hint: use the word "super") **Make sure you have commented the class and constructor and included @param or @return tags as needed! PART 3: Cylinder.java This class will model a Cylinder 3D shape. Instructions for Part 3: In the same project folder from Parts 1 and 2, create a new class file named Cylinder.java that will inherit from the Circular ShapeWith Height abstract class (hint: you need a keyword here - p. 444). Write the Class comment and @author and @version tags Write a constructor that takes radius and height as parameters Inside the constructor, call the "superclass" constructor and pass the parameters (hint: use the word "super") ** Make sure you have commented the class and constructor and included @param or @return tags as needed! Testing Once you have written all classes, please download and save ShapesTester.java in your project folder. Run ShapesTester.java and correct any errors in your Model classes. The output should be: The Diameter of a Circular Cone with those Dimensions is: 15.80 Expected: 15.80 The Cross Section Area of a Cirular Cone with those Dimensions is: 196.07 Expected: 196.07 The Cross Section Perimeter of a Cirular Cone with those Dimensions is: 49.64 Expected: 49.64 The Diameter of a Cylinder with those Dimensions is: 12.60 Expected: 12.60 The Cross Section Area of a Cylinder with those Dimensions is: 124.69 Expected: 124.69 The Cross Section Perimeter of a Cylinder with those Dimensions is: 39.58 Expected: 39.58 -----GRASP: operation complete. *NOTE: THE TEST DATA IN CODE CHECK WILL BE DIFFERENT, SO I WOULD RECOMMEND ADDING SOME OF YOUR OWN TESTS TO THIS FILE TO ENSURE EVERYTHING IS WORKING CORRECTLY. CircularCone.java 1 ** 2 * Add class comment and atags 3 4 */ 5 public class CircularCone extends CircularShapeWithHeight 6 { 7 8 } CircularShape With Height.java AWNE 1 ** 2 * Add class comment and atags 3 4 */ 5 6 public abstract class CircularShapeWithHeight 7 { 8 9} Cylinder.java 1 X** 2 * Add class comment and @tags 3 4 */ 5 6 public class Cylinder extends CircularShapeWithHeight 7 { 8 9} Submit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions

Question

LO2 Distinguish among three types of performance information.

Answered: 1 week ago