Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 More Than You Ever Wanted to Know About Pentagons Your assignment here is to create a Pentagon class to represent a regular Pentagon, which

image text in transcribed
image text in transcribed
1 More Than You Ever Wanted to Know About Pentagons Your assignment here is to create a Pentagon class to represent a regular Pentagon, which has five sides and all angles are of equal length. You will need to create the instance variables, constructors, and instance methods for the Pentagon. 1.1 Instance Methods There is only one thing that distinguishes any regular pentagon from another how big its sides are. Create an instance variable called size to represent the size of the sides. You only need one since they are all the same length. Make size private. If you cannot figure out this very first part do not continue any further with the assignment under any circumstances. Go back and rewatch the lectures or ask for help. 1.2 Constructors We want to set the size of the pentagon when we create it. Create a single constructor for Pentagon, which should take in a double. Use this double to set size of the pentagon. 1.3 Instance Method Complete the following instance methods: 1.3.1 Setters and Getters Create one setter and one getter methodl for the instance variable size 1.3.2 Perimeter Create a method that caleulates and returns the perimeter of the pentagon. 1.3.3 Height Create a method that calculates and returns the height of the pentagon. The pentagon's height is the distance fronm once corner to its opposite side

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 1 Lnai 6321

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215879X, 978-3642158797

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago