Love Work Family Friends Games Kids Life

Posted by on 2011/02/16 under Uncategorized

import java.awt.*;
import javax.swing.*;
import java.applet.*;
import java.util.*;

public class MathLan01
{
public static void main(String args[])
{
Geometryclass.dataEntry();
Util.skipln(2);
Geometryclass.display2DPerimeters();

}
}
class Geometry
{
static int height;
static int width;
static int length;
static int base1;
static int base2;
static int side;
static int radius;
public static void dataEntry()
{
Scanner input = new Scanner(System.in);

System.out.println(“Enter Height ==>”);
int height = input.nextInt();
//Util.skipln(1);
System.out.println(“Enter Width ==>”);
int width = input.nextInt();
//Util.skipln(1);
System.out.println(“Enter Length ==>”);
int length = input.nextInt();
//Util.skipln(1);
System.out.println(“Enter Base1 ==>”);
int base1 = input.nextInt();
//Util.skipln(1);
System.out.println(“Enter Base2 ==>”);
int base2 = input.nextInt();
//Util.skipln(1);
System.out.println(“Enter Side ==>”);
int side = input.nextInt();
//Util.skipln(1);
System.out.println(“Enter Radius ==>”);
int radius = input.nextInt();
//Util.skipln(1);
}

public static void display2DPerimeters()
{
System.out.println(“2 Dimensional Shapes: Perimeters”);
System.out.println(“________________________________________________”);
Util.skipln(1);
System.out.println(“Square Perimeter: “+perimeter(side));
System.out.println(“Pentagon Perimeter: “);//+Geometryclass.squarePerimeter);
System.out.println(“Hexagon Perimeter: “);//+Geometryclass.squarePerimeter);
System.out.println(“Octoagon Perimeter: “);//+Geometryclass.squarePerimeter);
System.out.println(“Rectangle Perimeter: “);//+Geometryclass.squarePerimeter);
System.out.println(“Circle Perimeter Perimeter: “);//+Geometryclass.squarePerimeter);
}

public static int perimeter(int n1)
{
int sum = n1+n1+n1+n1;
return sum;

}
}
class Util
{
public static void skipln(int n)
{
for (int x = 0; x

Leave a Reply

Name and Mail are optional. Your email address is however required if you want to subscribe to the comments (see below)

This site uses Akismet to reduce spam. Learn how your comment data is processed.