A regular polygon is an n-sided polygon

Assignment Help JAVA Programming
Reference no: EM13165182

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 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.

 

 

Reference no: EM13165182

Questions Cloud

What is the molecular weight of the hormone : An aqueous solution containing 21.6 mg of vasopressin in 100.0 mL of solution has an osmotic pressure at 25.0 oC of 3.70 mmHg. What is the molecular weight of the hormone?
Design a 4-bit register based on four d flip-flops : Design a 4-bit register based on four D flip-flops with three inputs I (4-bit), c (2-bit), and clk, and one output A (4-bit). The register can do four different operations depending on the value
Using the expand, guess, and verify method find closed : Using the expand, guess, and verify method find closed form solutions for the following recurrence relations.
Analyze the societal implications of using this process : Discuss in detail, one way in which atomic nuclear decay takes place. What is the significance of atomic nuclear decay? Analyze the societal implications of using this process.
A regular polygon is an n-sided polygon : 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).
What mass of aluminum oxide can be formed : A mixture of 82.49 g of aluminum ( Picture = 26.98 g/mol) and 117.65 g of oxygen ( Picture = 32.00 g/mol) is allowed to react. What mass of aluminum oxide ( Picture = 101.96 g/mol) can be formed?
Write net ionic equations : Write net ionic equations for the following molecular equations. HBr is a strong electrolyte. (Include states-of-matter under SATP conditions in your answer. Use the lowest possible coefficients.)
Circular-wait scheme with various deadlock-avoidance scheme : Compare the circular-wait scheme with thevarious deadlock-avoidance schemes  banker's algorithm)
Compute the heat capacity of methanol : Calculate the heat capacity of methanol (methyl alcohol) at 40°C. 2.6kg of methanol at 15 C enter an evaporator. They exit as vapour at the boiling point.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program to read a file and encode

Write a program to read a file and encode the file to an encrypted file. And write a program to get an encrypted file and decode to original file. Your program should prompt the user to enter an input file name and an output file name

  Write complete java program to read from keyboard

Write complete Java program to read, from keyboard, a student's first and last name and six grades. It will display on screen last name then first letter of first name with a period.

  Java code using jframe

Write a Java code using JFrame. This code needs to manipulate 4 shapes(2 rectangles and 2 squares) in a 400x400 JFrame. This needs to manipulate the shapes in 3 different ways, using 3 different methods. One for translating a shape, one for proportio..

  I had to call a webservice

I had to call a webservice (1st line of code) and then from there created a loop but keep getting an error every time on the .getBusiness - I don't know what I should be using there instead of getBusiness.

  Write java program to select pine for furniture company

Write down the Java program for the furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany.

  Write an algorithm for fining the middle node

Write an algorithm for fining the middle node of a doubly linked list given both the head and the tail of the list.And Write a  recursive  java function that counts the number of nodes in a circularly linked list.

  Rock-paper-scissors :- java problem

Design decision marks are based on how you implemented our programs/classes.

  Display student details and classes in applet

Display student details and classes they have enrolled in Applet. The Applet should have following features. Update and View.

  Write a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  Prepare address book java application

Prepare an application that reads the contents of your address book file and prepare a user guide that includes a description of the functionality of your overall address book system.

  Qr codes are a popular way

QR codes are a popular way to encode data for easy reading by computerized cameras. True QR codes contain error correction, format specifiers, version information, and a size variable layout that makes them harder to decode and process

  Write java program which will permit user to make selection

Write the Java Program which will permit the user to make selection. You will present user with two options to perform, then you will perform action selected by user.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd