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
Does learning swift is hard? more than android?
ladessa [460]
No it is not. it's quite simple when you get the hang of it
4 0
3 years ago
12.2 Sort an array in ascending order Write a program that gets a list of integers from input, and outputs the integers in ascen
notsponge [240]

Answer:

Explanation:

The following code is written in Java, it asks the user for the number of inputs that will be made and then the inputs. These inputs are placed into an array. Then the array is sorted and printed out to the terminal.

public static void sortArrayList() {

           ArrayList<Integer> sortedList = new ArrayList();

           Scanner input = new Scanner(System.in);

           System.out.println("Enter number of digits in Array");

           int numberOfInputs = input.nextInt();

           for (int i = 0; i < numberOfInputs; i++) {

                   System.out.println("Enter a number");

                   sortedList.add(input.nextInt());

           }

           int n = sortedList.size();

           for (int i = 0; i < n; i++)

               for (int j = 0; j < n-i-1; j++)

                   if (sortedList.get(j) > sortedList.get(j + 1))

                   {

                       // swap arr[j+1] and arr[j]

                       int temp = sortedList.get(j);

                       sortedList.set(j, sortedList.get(j + 1));

                       sortedList.set(j + 1, temp);

                   }

           for (int x : sortedList) {

               System.out.println(x);

           }

       }

7 0
3 years ago
How to make a message appear in more than one slack channel
VMariaS [17]

Answer:

On your desktop, hover over the message you'd like to share and click the Share message icon on the right. Use the drop-down menu to choose where you'd like to share the message, and add a note if you'd like. Click Share to see the message expand.

Explanation:

7 0
3 years ago
Dennis is driving a car with his family onboard. His children are sitting on the backseat. They have a tablet and want to watch
Mice21 [21]

Answer:

A and D could work

Explanation:

they do basically does the same thing!!

8 0
3 years ago
Describe the tools that are required to accomplish each step in the data management process.
RideAnS [48]

Answer: The tools which are required to accomplish each step in the data management process are:

1. Cloud Data Management tools.

2. Master Data Management (MDM) tools.

3. Reference Data Management (RDM) tools.

4. ETL tools.

5. Data visualization and  analytics tools

Explanation:

Cloud Data Management tools with the help of various API's are able to connect multiples system with their data to the cloud. examples are amazon cloud, google API cloud.

MDM tools are used for creation and maintenance of reference data. example are Profisee

RDM tools is used with the MDM tools and are use to define the businesss processes over the reference data. Examples are Collibra.

ETL tools helps to load data of an organisation to data warehouses after transformation and testing the data pipeline constituting the data from different databases.

Data visualization  analytics tools helps to extract and generate report from the big sets of data which can help an organisation to take business decisions.

6 0
3 years ago
Read 2 more answers
Other questions:
  • By issuing concert tickets on the blockchain, fans can verify transfer of ownership from one digital wallet to another, rather t
    14·1 answer
  • What are the Positive and negative sites of the internet
    14·1 answer
  • What is the main characteristic of a Peer-to-Peer (P2P) network?
    8·1 answer
  • What do developers do to support software products
    14·1 answer
  • ____ is the only automated disk-to-disk tool that allows you to copy data to a slightly smaller target drive than the original s
    5·1 answer
  • You have just purchased a motherboard that has an LGA 1156 socket for an Intel Pentium processor. What type of memory modules wi
    14·1 answer
  • What is the FaFASA4caster used for
    10·1 answer
  • what will allow you to immediately exit the program without rebooting the computer, when you realize your browser is not respond
    7·1 answer
  • Please help ASAP!
    7·2 answers
  • Hosts on the Internet have ________ addresses. Group of answer choices both A and B neither A nor B IP data link
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!