Computers and Technology, 19.11.2020 19:20 tamikagoss22
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.
PROGRAMING LANGUAGE: java
Answers: 1
Computers and Technology, 22.06.2019 22:30, kierafisher05
What is the most popular genre of video games?
Answers: 1
Computers and Technology, 23.06.2019 22:20, tagerryawilson6
If i uninstall nba 2k 19 from my ps4 will my career be gone forever?
Answers: 2
Computers and Technology, 25.06.2019 08:00, lilkit
In designing a management information system (mis), after defining the system's objectives, the next step is to information in a useful formatintegrate the hardware and software componentscollect and analyze datause information for decision making
Answers: 2
Write code which takes inputs from the user for the number of sides (int) and side length (double),...
History, 26.02.2021 20:30
Mathematics, 26.02.2021 20:30
Mathematics, 26.02.2021 20:30
Mathematics, 26.02.2021 20:30
Mathematics, 26.02.2021 20:30