Triangle
Triangle
Triangle
/*
* Filename: "Triangle.java"
* Created by 1,000_naymes
* Purpose: to calculate the area of a square and circle based on input from user
*/
import javax.swing.JOptionPane;
public class Triangle
{
public static void main( String[] args )
{
/**************************************************************
declare and initialize variables
**************************************************************/
String openingMessage,
sideOneInputMessage,
sideOneString,
sideTwoInputMessage,
sideTwoString,
sideThreeInputMessage,
sideThreeString,
triangleMessage,
errorMessage,
outputMessage;
/**************************************************************
input
**************************************************************/
sideOneInputMessage = "Please enter the length of one side of your triangle.";
sideOneString = JOptionPane.showInputDialog( sideOneInputMessage );
sideOne = Double.parseDouble( sideOneString ); //converting string to
double
System.exit(0);
} //end main
} //end class
Page 2