subject

Write code which takes inputs from the user for the number of sides (int) and side length (double), then creates a regular polygon with these characteristics. The program should then print a sentence with the name of the shape and the area and perimeter as shown in the sample run. You should use the appropriate RegularPolygon methods to obtain the perimeter and area of the shape rather than attempting to calculate these values yourself. /
Sample run:

Enter number of sides:
> 5
Enter side length:
> 3.5
A regular pentagon with side length 3.5 has perimeter 17.5 and area 21.075848157214846
/

Hint: You can approach this problem by saving the int and double as variables, and then creating the RegularPolygon, or you can create the polygon and use methods to set the values of the sides and sidelength.


Write code which takes inputs from the user for the number of sides (int) and side length (double),

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Match each vocabulary word to its definition.1. desktoppicture used to represent acomputer application2. domainnetwork protectionsoftware code that can be viewed,3. iconmodified, and redistributed for freethe background screen on acomputer monitor4. url5. blogan online journalthe part of an internet address that6. firewallrefers to a group of computers on anetworkonline database of web pages7. intranetnetwork for use by an individual8. open address of a web page or9. wikiresource
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Which tab should you open to find the option for adding a header?
Answers: 1
question
Computers and Technology, 23.06.2019 02:50
There’s only one game mode that stars with the letter ‘e’ in cs: go. which of the options below is it?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
You know the right answer?
Write code which takes inputs from the user for the number of sides (int) and side length (double),...
Questions
question
Mathematics, 16.03.2020 20:10
Questions on the website: 13722363