Code is in Java. Will leave thumbs up and Thank you! To start, create a package hw2 for the assignment under your project for ITEC 2150. Part 1 Create a Part 1 subpackage p1 under the hw2 package. In the p1 subpackage, create a public abstract class Shape3D that models three- dimensional shapes. Create the following data fields and methods in the class: - A protected data field color which is of type String and a getter for the field. - A constructor public Shape(String color) that sets the color field to the argument. - Public abstract methods volume() and surfaceArea() with no argument that return the volume and surface area of the shape, respectively. The return type of both methods should be double. Create a public (concrete) class Ball as a subclass of the Shape3D class, and the following data fields and methods in the Ball class: - A private data field radius of type double representing the radius of a ball. - A constructor public Ball (String color, double radius) that sets the color and radius fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the ball, respectively. Of a ball with radius r, the volume is 34r3 and the surface area is 4r2 - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Box as a subclass of the Shape3D class, and the following data fields and methods in the Box class: - Private data fields length, width and height of type double representing the length, width and height of a box, respectively. - A constructor public Rectangle (String color, double length, double width, double height) that sets the color, length, width and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the box, respectively. Of a box with length l, width w and height h, the volume is lwh and the surface area is 2(lw+lh+wh) - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Cylinder as a subclass of the Shape3D class, and the following data fields and methods in the Cylinder class: - Private data fields radius and height representing the radius of the base circle and the height of a cylinder, respectively. - A constructor public Cylinder (String color, double radius, double height) that sets the color, radius and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the cylinder, respectively. Of a cylinder with radius r and height h, the volume is r2h and the su.
Code is in Java. Will leave thumbs up and Thank you! To start, create a package hw2 for the assignment under your project for ITEC 2150. Part 1 Create a Part 1 subpackage p1 under the hw2 package. In the p1 subpackage, create a public abstract class Shape3D that models three- dimensional shapes. Create the following data fields and methods in the class: - A protected data field color which is of type String and a getter for the field. - A constructor public Shape(String color) that sets the color field to the argument. - Public abstract methods volume() and surfaceArea() with no argument that return the volume and surface area of the shape, respectively. The return type of both methods should be double. Create a public (concrete) class Ball as a subclass of the Shape3D class, and the following data fields and methods in the Ball class: - A private data field radius of type double representing the radius of a ball. - A constructor public Ball (String color, double radius) that sets the color and radius fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the ball, respectively. Of a ball with radius r, the volume is 34r3 and the surface area is 4r2 - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Box as a subclass of the Shape3D class, and the following data fields and methods in the Box class: - Private data fields length, width and height of type double representing the length, width and height of a box, respectively. - A constructor public Rectangle (String color, double length, double width, double height) that sets the color, length, width and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the box, respectively. Of a box with length l, width w and height h, the volume is lwh and the surface area is 2(lw+lh+wh) - A toString method that returns a string in the default format of Intellij. Create a public (concrete) class Cylinder as a subclass of the Shape3D class, and the following data fields and methods in the Cylinder class: - Private data fields radius and height representing the radius of the base circle and the height of a cylinder, respectively. - A constructor public Cylinder (String color, double radius, double height) that sets the color, radius and height fields to the corresponding arguments. - Public (concrete) methods volume() and surfaceArea() that override and implement the corresponding abstract methods of the Shape3D class. They should compute and return the volume and surface area of the cylinder, respectively. Of a cylinder with radius r and height h, the volume is r2h and the su.