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

  Java script program for song

Construct a JavaScript program that declares and prints an array that includes at least twenty of your favorite songs.

  Implement the finite field gf

Write a program called "GF2.java" to implement the finite field GF(p n )where p is a prime number andn is a positive integer.You also need to write four methodsto realize.

  Menu based program to maintain student records

Write a menu based program to maintain student records. Your program should take the following inputs: 1. Student first name (max. 20 characters) 2. Student last name, (max. 20 characters) 3. Student scores (float/double), eg. 85.4 Problem

  Write java program to accept two words as input

Write a Java program that accepts two words as input and determines if one of them is resulting from changing the order of the others' letters.

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  Construct a bulls and cows program for my intro java class

construct a Bulls and Cows program for my intro Java class. This program needs to perform the basic functions of the game (determining how many cows there are and how many bulls there are and tell the player when they win), but it also needs to offer..

  Eclipse or netbeans environments

As recommendation, you can try to use Eclipse or NetBeans environments that are used also for other courses as: Introduction in Java programming and Intermediate programming.

  Enterprise java beans (ejb) in software development

Enterprise Java Beans (EJB) in software development, EJB technology, EJB application, Stateless Session Beans (SLSB), Stateful Session Beans (SFSB), Message Driven Bean (MDB), Entity Bean

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Program that allows a user to input coordinates

In Java make a program that allows a user to input coordinates as to make a Hexagon via an array, and my professor has set the standards of: Write a class Polygon which draws a hexagon for a set of numbers given by the user.

  Method called wordlengths that accepts a scanner

Write a method called wordLengths that accepts a Scanner representing an input file as its argument. Your method should read from the given file.

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