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]
4 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]4 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
Hello! Please Answer This One Question!<br><br>Write a 50-word summary about Digital Citizenship
zloy xaker [14]

Answer:

The term digital citizenship, also known as e-citizenship or cyber-citizenship, refers to the use of Information and Communication Technologies (ICT), and the principles that guide them, for the understanding of the political, cultural and social issues of a nation.

More Content by Concept

In other words, it is about citizen participation through digital or electronic environments and interfaces, through the Internet and Social Networks.

Digital citizenship is part of the electronic government system or digital democracy, which precisely consists of the administration of State resources through new ICTs and all their potential, to make life easier for citizens.

In this way, a digital citizen has the right to access information online in a safe, transparent and private way, in addition to the social and political participation that 2.0 media allows.

Explanation:

6 0
3 years ago
What types of items can tab be used to complete once you start typing the entities' name?
White raven [17]
The answer to this question is <span>file, command, or directory names
File is the part of the program that could be used to store various information. The command is part of the program that give abilities for user to run a certain program within the system operation. Directory names will create some sort and arrangement on collection of files</span>
3 0
3 years ago
What is the name of the "local user" account involved in the alleged actions (Hint: where in the file structure did you find the
Sunny_sXe [5.5K]

I will assume this is a windows computer

Answer:

  • Disk (Letter)\Users\<"Answer">\Folder\Documents\SuspiciousFile.exe
  • You can use Windows Security Logs to try and find out from what IP address the user you just found logged in from.

Explanation:

The windows user folder has folders that contain each users data, Using the file path of the suspicious file you can figure out which user is associated with the file.

Windows Security Logs collect data on logon attempts so when the user logs in their IP address should be collected in these log files.

8 0
3 years ago
What service is used when your email program exchanges messages with the mail server on a distant network?
Verizon [17]

The answer is SMTP (Simple Mail Transfer Protocol)

SMTP is a TCP/IP protocol used in sending and receiving emails. This service is usually used with two other protocols, IMAP or POP3. Most email systems nowadays used SMTP to send messages from one server to another. Generally, an SMTP is used to send messages from a mail client to a mail server.

4 0
3 years ago
Before you insert a page break, what should you do? select the font you want to use for the text that comes after the page break
Triss [41]
Put the insertion point where you want the page to break is what I would write.
7 0
3 years ago
Other questions:
  • Use the following business rules to assign name to the tables on the ERD: Note: These rules are in the context of a small retail
    7·1 answer
  • Which of the following is not an important consideration before a business invests in a particular technology?
    12·1 answer
  • What happens to the data in rom when the power is turned off?
    10·1 answer
  • Transcoding digital videos does not cause a loss of quality. <br> a. True <br> b. False
    9·1 answer
  • An interface is a class that contains only the method headings and each method heading is terminated with a semicolon. True Fals
    7·1 answer
  • The first synthesizers were small simple machines that were easy to use. a. true b. false
    12·1 answer
  • Write a C program to input basic salary of an employee and calculate gross salary according to given conditions.
    11·1 answer
  • Why is it so important to adhere to principles that have been put forth by reputable organizations to ensure that you are mainta
    10·1 answer
  • 8. What is the order of growth execution time of the push operation when using the LinkedStack class, assuming a stack size of N
    13·1 answer
  • What is the difference between the shares Folder and Sessions Folder in the Shared Folders tool?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!