we have shape class. The aim is to fully implement the functionality of a shape class, with following critieria • You m

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

we have shape class. The aim is to fully implement the functionality of a shape class, with following critieria • You m

Post by answerhappygod »

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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply