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
Gnesinka [82]
3 years ago
15

A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree (i.e.,the

polygon is both equilateral and equiangular). The formula for computing the area of a regular polygon is:
Area = (n * s²) / (4 * tan(π/n))
Write a method that returns the area of a regular polygon using the following header:
public static double area(int n, double side)
Write a main method that prompts the user to enter the number of sides and the side of a regular polygon and displays its area.
Computers and Technology
1 answer:
butalik [34]3 years ago
4 0

import java.util.Scanner;

public class polygon {

/** Main Method */

public static void main(String[] args) {

 Scanner input = new Scanner(System.in); // Create a Scanner

 // Prompt the user to enter the number of sides  

 // and the side of a regular polygon

 System.out.print("Enter the number of sides: ");

 int n = input.nextInt();

 System.out.print("Enter the side: ");

 double side = input.nextDouble();

 // Display the area of the regular polygon

 System.out.println("The area of the polygon is " + area(n, side));

}

/** Method area computes and returns the area of a regular polygon */

public static double area(int n, double side) {

 return (n * Math.pow(side, 2) / (4 * Math.tan(Math.PI / n)));

}

}

You might be interested in
Why is data processing done in computer
oksian1 [2.3K]

Answer:

Explanation:

Data processing occurs when data is collected and translated into usable information. Usually performed by a data scientist or team of data scientists, it is important for data processing to be done correctly as not to negatively affect the end product, or data output.Any use of computers to perform defined operations on data can be included under data processing.

6 0
3 years ago
Each wireless network has its own name to identify it, known as service set identity. true false
Dominik [7]
True. The acronym for service set identity is SSID, which you've likely saw before. And like you say, it's simply the unique name given to a wireless network so that we are able to identify what network we are connecting to.
8 0
2 years ago
Which of the following statements is CORRECT? a. Multiple IRRs can occur only if the signs of the cash flows change more than on
BigorU [14]

Answer: i think the answer is

a. Multiple IRRs can occur only if the signs of the cash flows change more than once.

Explanation:

3 0
2 years ago
How will you keep the buzz going post-hackathon?
Anna71 [15]

Answer:

it would be nice if you gave some form of info here

Explanation:

in other words without information no help aka I'm slow and just need points

8 0
1 year ago
Sarah is working on a project in which she needs to record all the extracurricular activities in her college. Her college teache
EastWind [94]
It sounds like the answer is A because there are 5 types of sports and the question only asks for the sports folders
8 0
3 years ago
Read 2 more answers
Other questions:
  • A(n) ____ loop executes a predetermined number of times.
    12·1 answer
  • A ____ is a type of program that uses a grid to organize and work with data.
    14·1 answer
  • Please conduct some research and find an article on Security Threats and please provide link of the article.
    5·1 answer
  • 1.What is the term referring to an amount of money that is owed?
    6·2 answers
  • What are the 4 features of the month-end review tool in quickbooks online accountant?
    14·1 answer
  • If the three operations were combined, O(logN) + O(N) * O(logN) + 1, the overall algorithm cost would be:________
    6·1 answer
  • Lee has changed the style of his table to make the header row stand out. Next, he wants to center the text in the header row and
    11·2 answers
  • List three features of the third generation of computers
    13·1 answer
  • Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose
    15·1 answer
  • 23. Convert the following to Megabytes<br> a) 2GB<br> b) 2056 Bytes-
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!