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
Citrus2011 [14]
4 years ago
9

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 po

lygon is both equilateral and equiangular). The formula for computing the area of a re polygon is
n * s2(s squar)
area = -----------------------------------------
4 * tan(pi/n)
write a function that return the area of a regular polygon using the following header.
double area(int n, double side.
write a main function that prompts the user to enter the number of sides and the side of a regular polygon, and display the area.
The program needs to allow the user to run the calculations as needed until the user chooses to end the program.
Computers and Technology
1 answer:
sammy [17]4 years ago
4 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

    int n;

    double side;

    char choice;

    while(true){

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

     n = input.nextInt();

     System.out.print("Enter the side of a regular polygon: ");

     side = input.nextDouble();

   

     System.out.println("Area is: " + area(n, side));

     

     System.out.print("Do you want to continue(y/n): ");

     choice = input.next().charAt(0);

     

     if(choice == 'n')

         break;

    }

}

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

    double area = (n * Math.pow(side, 2) / (4 * Math.tan(Math.PI / n)));

    return area;

}

}

Explanation:

Create a function named area that takes two parameters, n and side

Calculate the area using the given formula

Return the area

In the main:

Create an indefinite while loop. Inside the loop:

Ask the user to enter the n and side

Call the area() function passing the n and side as parameters and print the result

Ask the user to continue or not. If the user enters "n", stop the loop

You might be interested in
In additon to setting up services, what other tasks does a sysadmin have to keep in mind? check all that apply.
kotegsom [21]

Tasks that a sysadmin have to keep in mind are:

  • Security Patches (A secure network is an important responsibility for SysAdmin)
  • Routine Updates (services need to be updated)
  • Maintain Compatibility

<h3>What is sysadmin?</h3>

A system administrator, or sysadmin, or admin is a person who is responsible for the upkeep, configuration, and reliable operation of computer systems, especially multi-user computers, such as servers.

The system administrator seeks to ensure that the uptime, performance, resources, and security of the computers they manage meet the needs of the users, without exceeding a set budget when doing so.

To meet these needs, a system administrator may acquire, install, or upgrade computer components and software; provide routine automation; maintain security policies; troubleshoot; train or supervise staff; or offer technical support for projects.

Learn more about SysAdmin

brainly.com/question/20381778

#SPJ4

5 0
2 years ago
Communication protocols, sets of rules agreed to by all parties, are designed in order to:
mote1985 [20]

Group of answer choices.

A. Ensure that cell phones and laptops cannot communicate.

B. Give each country its own internet language.

C. Ensure that new technologies and devices that haven't been invented yet can all use the same methods of communication.

D. Assure that computers and other devices don't pollute the environment.

Answer:

C. Ensure that new technologies and devices that haven't been invented yet can all use the same methods of communication.

Explanation:

OSI model stands for Open Systems Interconnection. The seven layers of OSI model architecture starts from the Hardware Layers (Layers in Hardware Systems) to Software Layers (Layers in Software Systems) and includes the following;

1. Physical Layer

2. Data link Layer

3. Network Layer

4. Transport Layer

5. Session Layer

6. Presentation Layer

7. Application Layer

Each layer has its unique functionality which is responsible for the proper functioning of the communication services.

Additionally, a standard framework for the transmission of informations on the internet, it is known as the internet protocol suite or Transmission Control Protocol and Internet Protocol (TCP/IP) model. One of the very basic rule of the TCP/IP protocol for the transmission of information is that, informations are subdivided or broken down at the transport layer, into small chunks called packets rather than as a whole.

Hence, communication protocols, sets of rules agreed to by all parties, are designed in order to ensure that new technologies and devices that haven't been invented yet can all use the same methods of communication.

This ultimately implies, there exist standard frameworks and protocols that are designed and developed to serve pre-existing technologies and devices, as well as those that would be invented in the future.

For example, SMTP is an acronym for Simple Mail Transfer Protocol and it uses the standard port number of 25 to provide clients with requested services on an internet-enabled device.

3 0
3 years ago
Lossless and lossy are the two (2) universally known categories of compression algorithms. Compare the two (2) categories of alg
Romashka-Z-Leto [24]

Answer:

The lossy compression method is also known as irreversible compression and is beneficial if the quality of the data is not your priority. It slightly degrades the quality of the file or data but is convenient when one wants to send or store the data. This type of data compression is used for organic data like audio signals and images. The algorithm use in Lossy compression include: Transform coding, DCT, DWT, fractal compression, RSSMS.

The Lossless compression method is also known as reversible compression and is capable of reconstituting the original form of the data. The quality of the data is not compromised. This technique allows a file to restore its original form. Lossless compression can be applied to any file format can improve the performance of the compression ratio. The algorithm use in Lossless compression include: RLW, LZW, Arithmetic encoding, Huffman encoding, Shannon Fano coding.

Advantage of Lossy compression: Lossy compression can achieve a high level of data compression when compared to lossless compression.

Advantage of Lossless compression: Lossless compression doesn’t degrade the quality of data during compression

Disadvantage of Lossy compression: Lossy compression degrades the quality of the data during compression

Disadvantage of Lossless compression: Lossless compression has less data holding capacity when compared to lossy method

Example of type of data for Lossless compression: Text

Example of type of data for Lossy compression: Audio

Explanation:

8 0
3 years ago
Read 2 more answers
What is the total number of time zones that can be configured to show by default in a calendar in Outlook 2016?
olganol [36]

Answer:

I think its 2, but correct me if i'm wrong. :>

Explanation:

6 0
2 years ago
A device that makes it possible for multiple customers to share one address is called a/n _____.
Debora [2.8K]
When you use the word "address", I assume you are referring to an external address, in which case the answer is NAT (network address translation). Essentially, network address translation converts LAN IP addresses (local IP addresses) to WAN  IP addresses (external IP addresses). So for instance: everyone in my home accesses the internet under our network's external IP address. Inside our network, we have local IP addresses, which allow for packets to be routed to our individual machines wirelessly. So let's say my IP address on the LAN is 192.168.1.4, and I want to access brianly.com. My router performs NAT by converting my local IP to an external one which can be used for accessing the web. Then when data comes back to the network from brainly's server, my router once again performs NAT to convert between my external IP to my local IP, so that my router knows where the data needs to be routed to on the LAN.
6 0
4 years ago
Other questions:
  • The use of digital technology and the Internet to execute the major business processes in the enterprise is called
    11·1 answer
  • How can you tell if a website is secure
    13·1 answer
  • Consider the following code: // Merge mailing list m2 into m1 void merge (MailingList m1, MailingList m2) { for (int i = 0; i &l
    12·1 answer
  • A store owner keeps a record of daily transactions in a text file. Each line contains three items: The invoice number, the cash
    7·1 answer
  • Explain what is meant by information technology (IT). Explain what is meant by information systems (IS). Why is it important to
    7·1 answer
  • You need to extract data from the system your predecessor created. you discover tables have been created according to the third
    7·1 answer
  • Literally no one helps answer my questions so this website is pointless.... : /
    11·1 answer
  • Write a C++ program that determines if an integer is a multiple of 7. The program should prompt the user to enter and integer, d
    13·1 answer
  • In an array-based implementation of a dictionary, if you represent the entries as an array of objects that encapsulate each sear
    12·1 answer
  • Write l for law of enrtia,ll for law of Acceleration and lll for law of enteraction.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!