I understand that you can't call a method within a method but I just can't see whats going on here...PLEASE HELP
import java.util.Scanner;
public class mg
{
public static void main ( String[] args)
{
public static double milligrams (double bodyweight)
{
double milligrams = bodyweight * .8;
return milligrams;
}
double result1 = milligrams(a);
System.out.println(" How much do you weigh?");
double a = in.nextInt();
System.out.println(" You need to take " + result1);
}
}
}
--- Update ---
Errors :
mg.java:8: illegal start of expression
public static double milligrams (double bodyweight)
^
mg.java:8: ';' expected
public static double milligrams (double bodyweight)
^
mg.java:8: '.class' expected
public static double milligrams (double bodyweight)
^
mg.java:8: ';' expected
public static double milligrams (double bodyweight)
^
mg.java:22: class, interface, or enum expected
}
^