Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculator
#1
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".


Messages In This Thread
Calculator - by Aaron Rogers118 - 04-28-2013, 07:05 PM
Re: Calculator - by Aaron Rogers118 - 05-02-2013, 12:28 PM
Re: Calculator - by brandonio21_phpbb3_import2 - 05-02-2013, 02:38 PM
Re: Calculator - by Aaron Rogers118 - 05-06-2013, 10:05 AM
Re: Calculator - by brandonio21_phpbb3_import2 - 05-06-2013, 02:23 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)