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 task, performed by systems developers, will most likely ensure that end users accept a new system?
aalyn [17]
I would say "beta testing" helps to make sure users will accept a system.
6 0
4 years ago
Need the answer rn!!!!
Julli [10]

Answer:

what language is this? english or no

Explanation:

8 0
3 years ago
Toolchain "mingw gcc" is not detected. refer to "c/c++ development user guide", "before you begin" how to install toolchains.
QveST [7]
<span>Answer: "The CDT MinGW toolchain will find this install if it is located in the default C:\MinGW directory, the MinGW bin directory is placed in your path, or if the MinGW location is stored in the MINGW_HOME environment variable. Note that the Wascana IDE has been discontinued."</span>
5 0
3 years ago
Plz help me on this one
abruzzese [7]
I can’t see all the answer choices.
8 0
3 years ago
Read 2 more answers
Learning Task 5. Identify the terms being described below. Write your answer in your answer
Charra [1.4K]

Answer:

1. Waste management.

2. Substitution.

3. Personal hygiene practices.

4. Emergency preparedness.

5. Elimination.

6. Flammability limit.

7. Occupational safety and health (OSH).

8. Engineering controls.

9. Personal protective equipment (PPE).

10. Administrative controls.

Explanation:

1. <u>Waste management</u>: this refers to the collection, transportation, processing or disposal, managing and monitoring of waste materials.

2. <u>Substitution</u>: this refers to the hazard control which involves the measure of replacing one hazardous agent or work process with less dangerous one.

3. <u>Personal hygiene practices</u>: a very important method of controlling hazards which involves proper washing of your hair, skin, body and even your clothes.

4. <u>Emergency preparedness</u>: this refers to the preparedness for the first and immediate response in case of any type of emergency.

5. <u>Elimination</u>: this hazard control refers to the removal of a specific hazard or hazardous work process.

6. <u>Flammability limit</u>: is the term used to call the range of concentration over which a flammable vapor mixed with air will flash or explode if an ignition is present.

7. <u>Occupational safety and health (OSH)</u>: a cross-disciplinary area concerned with protecting the safety, health and welfare of people engaged in work or employment.

8. <u>Engineering controls</u>: the term used in hazard control which involves changing a piece of machinery or work process.

9. <u>Personal protective equipment (PPE)</u>: the term used to call any piece of equipment which is used to protect the different parts of the body such as ears and eyes such as respirators, face mask, face shield, gloves, boots, etcetera.

10. <u>Administrative controls</u>: this is a form of hazard control which involves manipulation of worker/employee’s schedule and job rotation.

7 0
3 years ago
Other questions:
  • Being aware of and understanding why potential buyers on a web site do not complete their purchases requires the expertise of __
    11·2 answers
  • Which is a challenge in photographing forests
    14·2 answers
  • If you're under 18 and you receive _____ or more license points in 12 months, you'll be restricted to driving only to school or
    11·1 answer
  • The type of database that is most capable of supporting complex data types is _____. Select one: a. sequential files b. relation
    7·2 answers
  • List with ecamples five important applications areas of computer today​
    15·1 answer
  • What are the two types of commennts of java​
    12·1 answer
  • MOA115 Medical Records and Insurance
    6·1 answer
  • Write a function that receives a one-dimensional array of integers and returns a Python tuple with two values - the minimum and
    10·1 answer
  • A combined counting and logical looping statement may be needed in the following situations: (a). The values stored in a linked
    7·1 answer
  • Date Underline the correct answer from the options. 1. How many basic input devices does a desktop computer have? .. a)2 b)3 c)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!