we have shape class. The aim is to fully implement thefunctionality of a shape class, with followingcritieria •
You must have an interface for Shape •
You will develop the following classes implementing Shape:
o Square
o Triangle (assume that it is an equilateral triangle, meaningall of its sides are equal)
o Circle
o Pentagon •
Each shape must be able to perform the followingfunctionalities:
o Get the area of the shape
o Get the perimeter of the shape
o Get/set the parameters of a shape:
▪ A circle has a center and a radius
▪ A triangle has a center and the length of the side
▪ A square has a center and the length of the side
▪ A pentagon has a center and the length of the side (all sidesof the pentagon are equal)
o Ability to move the shape into a new location according to anoffset x and offset y
• What to submit:
o Your source code containing the following files only: ▪Shape.java ▪ Pentagon.java ▪ Circle.java ▪ Triangle.java ▪Square.java ▪ Main.java (creating a minimum of 2 instances for eachshape and showing the functionality
o UML diagram
we have shape class. The aim is to fully implement the functionality of a shape class, with following critieria • You m
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am