1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jeka94
3 years ago
10

Write code which takes two inputs from the user, a number of sides followed by a side length, then creates a regular polygon wit

h that number of sides and side length.Sample run:Type the number of sides:8Type a side length:7.5regular octagon with side length 7.5Hint: Make sure you use the right data types when taking user input.
Computers and Technology
2 answers:
SVETLANKA909090 [29]3 years ago
8 0

Answer:

import java.util.Scanner;

public class Polygon {

       public static void main(String[] args) {

               Scanner sc = new Scanner(System.in);

               System.out.println("Type the number of sides:");

               int sides = sc.nextInt();

               System.out.println("Type a side length:");

               double length = sc.nextDouble();

               if (sides== 5){

                      System.out.println("Pentagon, length "+length);

               } else if (sides == 6){

                      System.out.println("Hexagon, length "+length);

               } else if (sides == 7){

                      System.out.println("Heptagon length "+length);

               } else if (sides == 8){

                       System.out.println("Octagon, length "+length);

                } else if (sides == 9){

                       System.out.println("Nonagon, length "+length);

                 } else if (sides == 10){

                       System.out.println("Decagon, length "+length);

} else if (sides == 11){

                       System.out.println("Undecagon, length "+length);

} else if (sides == 12){

                       System.out.println("Dodecagon, length "+length);

} else {

                       System.out.println("Please choose a valid number.");

               }

       }

}

Explanation:

The Java source code defines a class called 'Polygon' the main method of the class prompts for user inputs for the sides and length variables. The nested if-statement prints the type of polygon with respect to the number of sides.

Ahat [919]3 years ago
5 0

Answer:

i need free point sorry lol

Explanation:

You might be interested in
Which of the following problems is least likely to be solved through grid computing? Financial risk modeling Gene analysis Linea
gregori [183]

Answer:

Linear problems

Explanation:Grid computing is the term used in Information technology, Computer programming and Computer networks to describe the interconnection of different Computer resources in order to achieve certain specified goal. GRID COMPUTING ALLOWS COMPUTER RESOURCES TO WOK AS A SINGLE UNIT.

Grid computing can be used to solve various issues connected with the use of Computer resources such as Financial risk modelling,Gene analysis etc but least likely to be used to solve Linear problems.

6 0
3 years ago
)How to extract a specific element of item in a list?
pogonyaev

Answer:

List items are usually accessed using the indexing operator.

Explanation:

Depends on the language, and what you mean with extracting? Do you mean accessing or removing?

3 0
3 years ago
Supposethatyoubet$5oneachofasequenceof50independentfairgames. Usethecentrallimittheorem to approximate the probability that you
lions [1.4K]

Answer:

0.119

Explanation:

50 independent fair games

Mean will be 50/2 = 25

Standard deviation of the loosing probability is :

\sqrt{50*0.5*0.5} * 10 = 33.536

we have to loose 33 times out of 50 games.

To find the approximate probability we use z- value table.

z value =  \frac{33-25}{3.35}

z - value = 2.2659

Looking at the z-value table we get 0.119.

8 0
3 years ago
Darian has a gourmet cupcake business and needs a website to compete with the other bakeries in his area. He has a Google My Bus
Amiraneli [1.4K]

Answer:

The sequences are given below that is 3, 4, 5, 2, and 1.

Explanation:

The following steps are taken to develop the site via Google My Business.

  • In the first case, He signs his Google My Business.
  • In the second case, the site is accessed from the Home menu.
  • In the third case, the appropriate business details become modified.
  • In the fourth case, he attaches photos, like such a cover picture as well as a virtual guide.
  • In the fifth case, he selects the particular domains as well as directs this to the site.
7 0
3 years ago
25 pts! If programmers cannot write an algorithm because the problem is too complex, which methodology can they use to reach an
Setler [38]

Answer:

D, most likely thats what I was taught .

3 0
3 years ago
Other questions:
  • Which is a copyright
    5·1 answer
  • In Python,The sum of the elements in a tuple can be recusively calculated as follows:The sum of the elements in a tuple of size
    5·1 answer
  • Which of the following instruments are used when performing a high-rate discharge test on a storage battery
    7·1 answer
  • A computer with a frequency 2 GHZ and its average cycle per instruction is 2. what is the MIPS of the computer?
    6·1 answer
  • Instagram
    9·1 answer
  • How to fix dark images?<br><br>I am using a phone btw​
    14·2 answers
  • Fix thos code:Error using spm_check_installation&gt;check_basic (line 93) You do not appear to have the function search path set
    6·1 answer
  • Your ___ can provide hardware firewall protection for your home network where it connects to the ISP's network, just as ISP netw
    12·1 answer
  • In which table is the input and the corresponding output of a Boolean function listed? How is the output of the NAND gate determ
    9·1 answer
  • ________ is a group meeting-based process for requirements collection. a. Reverse engineering b. Joint application design c. Hum
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!