All pastes #773326 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-14 13:29 UTC
rendered paste body
import java.util.Scanner;

public class ExactRegularPolygon {

	public static void main ( String [] args ) {

	Scanner input = new Scanner (System.in);
	int n = 0;
	float s = 0, perimeter = 0, r = 0;
	double R = 0;
	float circumare = 0, inscrarea = 0, area = 0;
	String ni;

	System.out.println("How many sides on this polygon?");
	ni = new String( input.next() );
	n = Integer.parseInt(ni);
	
	System.out.println("And how long are the sides?");
	s = Float.parseFloat(input.next());
	

	perimeter = n * s;
	R = s / (2 * (Math.sin(Math.PI/n)));
 
	System.out.println(R);



		}
}