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
What name is given to any changes to the original data such as users manually modifying data, programs processing and changing d
nadezda [96]

Modification is the name given to an attack that makes changes into original data such as users manually modifying data, programs processing and changing data, and equipment failures.

In modification attacks, only changes are made to original data without deleting it completely. Modification is basically a type of attack in the context of information security. This type of attack creates annoying situations and discords by altering existing data in data files, inserting new false information in the network and reconfiguring network topologies and system hardware.

Modification attack is mainly mounted against sensitive and historical data. Modification attacks target integrity of the original data with an intent of fabricating it.

You can learn more about ha-cker attack at

brainly.com/question/14366812

#SPJ4

3 0
1 year ago
You should check your battery ___________. Every week Never Every six months Every 30,00 miles
vova2212 [387]

The answer is Every six months

A battery acts as the brain of a car and is used to power almost everything. It can last up to five years. However, this lifespan will depend on how well the battery is maintained and the type of weather conditions you live in. Aim to check your car battery at least twice a year. Actually, it is best to check your battery regularly and not to wait for your mechanic to test your battery during routine servicing.

5 0
3 years ago
Read 2 more answers
How many rows appear in a truth table for the compound proposition: \[(p \leftrightarrow q) \oplus (\neg p \leftrightarrow \neg
AURORKA [14]
Let me re-write the proposition:

p↔q⊕(¬p↔¬r)∧¬q.

Generally, the number of rows in a truth table depends on the number of Variables. Here we have 3 Variables: p,q and r. Each of them can have either the value of 1 or 0, which gives us 2*2*2 possibilities, or 2³, that is 8 possibilities and 8 rows:

p=0, q=0, r=0
p=0, q=0, r=1
p=0, q=1, r=0
p=0, q=1, r=1
p=1, q=0, r=0
p=1, q=0, r=1
p=1, q=1, r=0
p=1, q=1, r=1







4 0
2 years ago
P16 Consider the following network. ISP B provides national backbone service to regional ISP A. ISP C provides national backbone
Art [367]

Solution :

Considering the following data :

$\text{ISP B}$ provides the national backbone to the regional $\text{ISP A}$.

$\text{ISP C}$ provides the national backbone to the regional $\text{ISP D}$.

Each of the ISP consists of one autonomous systems (AS).

$\text{ISP B}$ would like to hand over the traffic of C through the $\text{West}$ Coast.

The $\text{ISP C}$ would like to receive traffic from B's peering point via East Coast.

One way for $C$ to force $B$ to hand over all of $B$’s traffic to $D$ on the east coast is for $C$ to  only advertise its route to $D$ via its east coast peering point with $C$.

7 0
2 years ago
What's good computing?
cestrela7 [59]

Answer:

1.Use passwords that can't be easily guessed, and protect your passwords.

2.Minimize storage of sensitive information.

3.Beware of scams.

4.Protect information when using the Internet and email.

5.Make sure your computer is protected with anti-virus and all necessary 6.security "patches" and updates.

7.Secure laptop computers and mobile devices at all times: Lock them up or carry them with you.

8.Shut down, lock, log off, or put your computer and other devices to sleep before leaving them unattended, and make sure they require a secure password to start up or wake-up.

9.Don't install or download unknown or unsolicited programs/apps.

Secure your area before leaving it unattended.

10.Make backup copies of files or data you are not willing to lose.

Explanation:

7 0
1 year ago
Other questions:
  • At the dsl local carrier's office, the __________ demultiplexes the data streams and converts them into digital data.
    10·1 answer
  • Name size of machine screw that is used to secure switches and receptacles to device boxes
    13·1 answer
  • The spreadsheet below shows the age, grade level, major, and minor of four students in college. A purple background in the Major
    7·1 answer
  • why do programs include keyboard shortcuts for certain actions? do you prefer the mouse or the keyboard/ why?
    7·1 answer
  • why is wrong timing, poor technology, bad implementation and politics in business affected the OSI model as a standard
    5·1 answer
  • This procedure protects against the loss of data
    5·1 answer
  • A computer is defined by 4 specific criteri. Select all 4.*
    7·1 answer
  • Fred wants to analyze his spending habits of the past few years and has gathered information on the checks he has written from 2
    6·1 answer
  • PLEASE HELP! I'm offering brainliest!
    6·1 answer
  • A project manager has designed a new secure data center and has decided to use multifactor locks on each door to prevent unautho
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!