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
If the algorithm does not have instructions for unanticipated results, the computer program will a. solve a problem b. start ove
MrMuchimi

Answer: halt, just did the question

6 0
3 years ago
GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
kumpel [21]
The answer is display information
4 0
3 years ago
Read 2 more answers
Which types of operating systems execute program independent of the users and generate output within a specific amount of time?
soldi70 [24.7K]
Real-Time Operating System –
These types of OSs serves the real-time systems. The time interval required to process and respond to inputs is very small. This time interval is called response time.

Real-time systems are used when there are time requirements are very strict like missile systems, air traffic control systems, robots etc.

https://www.geeksforgeeks.org/operating-system-types-operating-systems-awaiting-author/
3 0
3 years ago
How many passes will it take to find the five in this list?
Savatey [412]

Answer:

1 im prety sure

Explanation:

5 0
3 years ago
Read 2 more answers
Write a code snippet Now write your own code snippet that asks the user to enter two numbers of integer type (one at a time) and
taurus [48]

Explanation:

num1= print("Enter a number :")

num2 = print("Enter a number :")

sum = num1 + num2

print(sum)

4 0
2 years ago
Other questions:
  • An effectively distributed resume will get an interview
    12·2 answers
  • Obtain a file name from the user, which will contain data pertaining to a 2D array Create a file for each of the following: aver
    5·1 answer
  • Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that a
    12·1 answer
  • Anthony is responsible for tuning his organization's intrusion detection system. He notices that the system reports an intrusion
    8·1 answer
  • 100 tickets are sold in a raffle with one prize. John has 8 tickets, Jamie has 10 tickets, find the probability that John wins
    11·2 answers
  • Including the word OR will make a search less specific.<br> O False<br> O True
    8·2 answers
  • ¿Cuál es la diferencia entre una plataforma educativa y una tutoría?
    7·1 answer
  • Que papel tuvo la innovación en la propagación de la telefonía móvil?​
    7·1 answer
  • Computer Hardware can consist of a
    13·1 answer
  • Topic: Drivers ed 100 points and brainliest!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!