SWing;* ISsue dial dialogbox
I am trying to write a program where we calculate the number of calories needed each day for an active man or women by knowing the weight, height, and age. My program should be interactive with the user ask question to determine if the user is man or woman.
but for some reason I am not able to run this program. I am gonna past my code. If someone could look @ them closely, and tell me what I have to fix.
import javax.swing.*;
public class takehome2
{
public static void main ( String [] args)
throws java. io.IOExeception
{
String W,H,A;
double x,y,z,k1,k2;
G= JOptioonPane.showInputDialog (" enter gender:");
W= JOptionPane. showInputDialog("enter weight:");
H= JOptionPane. showInputDialog("enter height:");
A= JOptionPane. showInputDialog("enter Age:");
x= Double. parseDouble (W);
y= Double. parseDouble (H);
A= Double. parseDouble (A);
k1= 19.18W+7H-9.52A+92.4
k2= 9.7+6(W+H-A)
double largenum;
if (G==male)
largenum=k1
JOptionPane.showMessageDialog(null," Your calorie needed everyday is: "+k1,"calorie", JOptionPane. INFORMATION_MESSAGE);
else
largenum=k2
JOptionPane.showMessageDialog(null," Your calorie needed everyday is: "+k2,"calorie", JOptionPane. INFORMATION_MESSAGE);
System.exit(0);
}
}