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
For each of the users of accounting information, identify whether the user is an external decision maker (E) or an internal deci
jarptica [38.1K]

Answer:

Customer (E), Company manager (I), Internal Revenue Service (E), Lender (E), Investor (E), Controller (I), Cost accountant (I), SEC (E).

Explanation:

First of all, we need to define what exactly is an External Decision Maker (E) and an Internal Decision Maker (I).

External Decision Makers, these are people <u><em>outside the company</em></u><em> </em>that make decisions, for example: Customer, Internal Revenue Service, Lender, Investor and The U.S. Securities and Exchange Commission (SEC).

<u>Customers</u> are external because they don't belong to the company.

<u>Internal Revenue Service </u>is an institution of the  Government of the U.S., that's why is outside the company.

<u>Lender</u>, this person or financial institution is not involved in the company in self, only lends money to the company, that's it.

<u>Investor,</u> as it was said above, it's the person or institution that only lends the money to the company, without being part of the insides.

<u>The U.S. Securities and Exchange Commission (SEC)</u> is an institution of the U.S. Government, so it's outside the company.

Internal Decision Makers, these are people inside the company, they are absolutely involved in the direct decisions, for example, Company Manager, Controller and Cost Accountant.

<u>Company Manager</u> is the head of the company, the person in this position absolutely makes company decisions to coordinate all departments.

<u>Controller</u>, this person has the responsibility of all accounting related activities, that's why is an internal decision maker.

<u>Cost Accountant,</u> is an internal decision maker because is the person in this position has to be a financial specialist who determines costs of the products or services that the company offers.

So, there you have it, it's a pleasure to help.

4 0
4 years ago
Which property describes if a mineral breaks down into flatpieces​
marta [7]

Answer: Cleavage

Explanation:

3 0
3 years ago
What is output by the following program?
zubka84 [21]

The output of the program is 10.

def mult(a, b = 1, c = 1):

    print(a * b * c)

mult(2, 5)

<h3>Code explanation:</h3>

The code is written in python.

  • A function is declared named "multi" and the function has parameter of a, b and c. The default value of b and c are 1.
  • Locally, we print the product of a, b and c.
  • Finally, we call the function with its inputted parameters. Notice we only had 2 argument while calling the function. This simply implies that the default value for c is used. Therefore,  we will have 2 × 5 × 1 = 10

learn more on python here: brainly.com/question/22796383

8 0
2 years ago
What is the first step in setting up a good team at work?
Tatiana [17]

Answer:

set goals

Explanation:

6 0
3 years ago
Philip thinking about customizing his motorcycle paint job,saddlebags,and a radio would $600.his motorcycle is older,so he also
Elza [17]
The correct answer to this question is letter "A. He will be able to drive his motorcycle on his upcoming vacation."

There exists the same question from other source that has the following choices:

A. He will be able to drive his motorcycle on his upcoming vacation.
B. He will be able to lengthen the life of his motorcycle.
C. He will temporarily have less money in his bank account.
<span>D. He will spend more time with friends during the repairs.</span>
7 0
4 years ago
Read 2 more answers
Other questions:
  • Templates allow for the quick creation of _____.
    7·1 answer
  • Question 1 (1 point)
    10·2 answers
  • Your company has a wireless network for its small office network. The wireless network does not broadcast its service set identi
    11·1 answer
  • Which of these is an expansion slot type?
    5·1 answer
  • Use the following scale to rate yourself: (There is no wrong answer
    8·1 answer
  • 41. All the following software are examples of operating systems EXCEPT
    5·1 answer
  • Complete the sentence.<br> The IP protocol creates and addresses packets at the _____ layer.
    7·2 answers
  • Use the ________ tag to configure a generic area on a web page that is embedded within a paragraph or other block display elemen
    12·1 answer
  • The field of ____ is concerned with the technical issues involved in information display. computer science
    14·1 answer
  • Jobs that use math and science to solve problems involving the design and development of technologies can be found in the what c
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!