04-28-2013, 07:05 PM
I'm slowly learning java, mostly from Brandonio21's videos, and I have run into a problem. I need to know what I need to do with this code:
[code2=java]package howto;
import javax.swing.JOptionPane;
public class Calculator {
public static void main(String[] args)
{
JOptionPane myIO = new JOptionPane();
double inputText = myIO.showInputDialog("Please enter length:");
double lingth = inputText;
double inputText1 = myIO.showInputDialog("Please enter length:");
double width = inputText1;
double area = (lingth * width) / 2;
JOptionPane.showMessageDialog(null, "The area of the triangle is: " + area);
}
}[/code2]
I need help soon because it is for a school project called "How to".
[code2=java]package howto;
import javax.swing.JOptionPane;
public class Calculator {
public static void main(String[] args)
{
JOptionPane myIO = new JOptionPane();
double inputText = myIO.showInputDialog("Please enter length:");
double lingth = inputText;
double inputText1 = myIO.showInputDialog("Please enter length:");
double width = inputText1;
double area = (lingth * width) / 2;
JOptionPane.showMessageDialog(null, "The area of the triangle is: " + area);
}
}[/code2]
I need help soon because it is for a school project called "How to".