subject
Computers and Technology, 18.11.2020 23:00 Maaarii

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:40
Peripherals are part of the main computer. true false
Answers: 3
question
Computers and Technology, 22.06.2019 01:00
Program description: a c# app is to be created to produce morse code. the morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). in sound-oriented systems, the dot represents a short sound and the dash represents a long sound. separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. in a sound-oriented system, a space is indicated by a short period of time during which no sound is transmitted. the international version of the morse code is stored in the data file morse.txt.
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
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
Spanish, 09.11.2020 20:30
question
Mathematics, 09.11.2020 20:30
question
Mathematics, 09.11.2020 20:30
question
Mathematics, 09.11.2020 20:30