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
Question 1 Which portion of the PuTTY package allows you to perform file transfers using the SCP (Secure Copy) protocol?
Artyom0805 [142]

There are different aspect of computing. The portion of the PuTTY package that allows you to perform file transfers using the SCP (Secure Copy) protocol is pscp.exe.

The pscp.exe tool commonly called the PuTTY Secure Copy Client is known to be the only portion of the Putty package that can let you copy files to and from remote computers through the use of the SCP.

Secure Copy (SCP)  is simply defined as a computer command that one can use in Linux to copy files from one computer to another on a network.  PuTTY is simply known to be a free implementation of SSH (and telnet) used for computer that running Microsoft Windows.

Learn more about the PuTTY package from

brainly.com/question/13171394

8 0
3 years ago
What arw two reasons for maintaning your privacy on the internet
Mekhanik [1.2K]

Answer:

so people can't get your information and use it to their advantage and because you never know what people could do with that information

Explanation:

8 0
3 years ago
Read 2 more answers
Which of the following technologies can operate in the 125 kHz to 134 kHz range?
Sophie [7]

Technologies that can operate in the 125 kHz to 134 kHz range is the

B. RFID

Explanation:

  • RFID is technology which works on radio frequency and it is used for the auto-identification for the different object.
  • The RFID system mainly consists of two parts. In this RFID system, this RFID reader continuously sends radio waves of a particular frequency
  • RFID is the use of radio waves to read and capture information stored on a tag attached to an object, providing a unique identifier for an object.
  • Active RFID tags have a transmitter and their own power source. Instead, they draw power from the reader, which sends out electromagnetic waves that induce a current in the tag's antenna.
  • Semi-passive tags use a battery to run the chip's circuitry, but communicate by drawing power from the reader.
  • Radio frequency identification (RFID) can operate in three frequency bands: 125 kHz to 134 kHz, 13.56 MHz, or 856 MHz to 960 MHz. Bluetooth is 2.4 GHz; NFC is 13.56 MHz; and LTE is between 600 MHz and 6 GHz.
7 0
3 years ago
Who is the king of computers?
anygoal [31]

Answer: <u>Bill Gate</u>, who is known as the king of computer programs

Hope this helps!

4 0
2 years ago
Read 2 more answers
Which of the following is an online library?
Mice21 [21]
Answer A. Hope it helped c:
4 0
3 years ago
Read 2 more answers
Other questions:
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • What is data. Explain it in brief
    11·2 answers
  • Define the ADT list: its properties and methods
    14·1 answer
  • How does this app work?
    11·2 answers
  • You are required to design a 4-bit even up-counter using D flip flop by converting combinational circuit to sequential circuit.
    15·1 answer
  • Identify a stressor in your life. Conduct an internet search to locate at least two reliable sources of information on effective
    6·1 answer
  • Me inculparon de crear una cuenta en Facebook y colocaron el barrio donde vivo, ¿cómo podría demostrar lo contrario? Ayuda urgen
    6·1 answer
  • What is the working principle of computer?​
    10·1 answer
  • Please help I will mark brainliest
    11·2 answers
  • Which option will be used to attach email messages ​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!