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
Need help with this please and thanks
Kryger [21]

Answer:

<h3>Connector names are written below Picture vise:</h3>
  • USB-C
  • USB 2.0
  • Micro USB
<h3 />

Explanation:

Following is the brie Illustration of the terms used:

  • USB-C:

              It is the newest connector in the market with the             reversible/symmetrical design. It can be adapted to work with the legacy connectors such as USB-A, USB-B, USB-C and Micro USB.

  • USB 2.0:

              It is used mostly in the connections of electronic devices such as printers and smartphones. It has A to B connectors as well as micro USB connectors and mini USB connectors.

  • Micro USB:

              It is used for the connection o compact devices such as smartphone and mp3 players. They are further grouped into three categories: Micro A, Micro B and micro USB 3.

<h3>I hope it will help you!</h3>
7 0
3 years ago
Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off, and checki
vaieri [72.5K]

Answer:

yes?

Explanation:

8 0
2 years ago
Examination of Internet records in order to reveal the identity of an anonymous poster is defined as
Sergeu [11.5K]

Answer: Doxing

Explanation: Doxing which is also referred as doxxing is defined as the revealing or publishing of the private records or information to the public.It is considered as the illegal practice which is base on the the internet service.The publicizing of the private data or confidential information is punishable offence.

Other options are incorrect because filtering is the elimination of the not required content, spamming is the activity of sending undesired bulk messages and hacking is the attacking of the system using false means to corrupt and steal data.Thus the correct option is doxing.

6 0
3 years ago
Why is the keyboard calledQWERTY
taurus [48]
The standard QWERTY layout keyboard is called 'QWERTY' because on the top line of the keyboard the first 6 letters from chronological left to right order are; Q, W, E, R, T, and Y.

Or...if you're wondering why it's QWERTY and not ABCDEF, it's because when typing with the alphabetical format, many of the keys would clash with each other due to the arrangement of keys on the original typewriter. The QWERTY layout became so popular, it was the standardized layout for typewriters, and even keyboards today.
4 0
3 years ago
Read 2 more answers
A server is a special kind of computer that manages access to resources such as files, applications, peripherals, emails, and we
Basile [38]

Answer:

true

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memor
    8·1 answer
  • You want to enable nap so that all portal computers using wireless connections have an active firewall. which type of enforcemen
    11·1 answer
  • The Magic Square is a grid with 3 rows and 3 columns with the following properties: • The grid contains every number from 1 to 9
    9·1 answer
  • In preparing his persuasive presentation, Reza should most likely focus on clearly presenting his
    6·2 answers
  • Click on the _____ tab on the ribbon to open the backstage view.
    7·1 answer
  • Write code that does the following: opens an output file with the filename number_list.txt, uses a loop to write the numbers 1 t
    8·1 answer
  • Which functions are examples of logical test arguments used in formulas? Check all that apply. OR IF SUM COUNT NOT AND
    12·2 answers
  • [This is on Edhesive (coding and programming)]
    8·2 answers
  • Why is yo utu be down?<br> (You restrict talking about yo utu be, really)
    11·2 answers
  • What is the cpu used for
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!