Question: Due Date: 11-14-2018 Assignment #3 Square Class Name: Design a class named Square that extends GeometricObiect. The class contains: ata fields named sidel with default
Due Date: 11-14-2018 Assignment #3 Square Class Name: Design a class named Square that extends GeometricObiect. The class contains: ata fields named sidel with default values 1.0 to denote the side of the square. A no-arg constructor that creates a default square. . A constructor that creates a square with the specified sidel. . The accessor and mutator methods for data fields. . A method named getArea0 that returns the area of this square. .A method named getPerimeterO that returns the perimeter of this square. . A method named toString0 that returns a string description for the square. For the formulas to: Compute the area- (side12) Compute the perimeter 4 times sidel (4'sidel) The toString method is implemented as follows: return "Square: sidel "+sidel; Draw the UML diagram that involves the classes Square and GeometricObject. Implement the class Write a test program that creates a Square object. Use Scanner object to enter the side1 of the square. Use mutator(s) method to initialize square class reference variable (sidel), color yellow and filled true. Use accessor methods and display the area, perimeter, color, and whether filled or not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
