Hi can any one help with J Grasp?
Hi can any one help with J Grasp This is the program I wrote but I’m getting a the following error below import java.uti.Scanner; public class Salary {public static void main (String[]args) { double gross,tax,deduct,net,medaid=500,pension=500; Scanner sc=new Scanner (System.in); System.out.println("Enter gross"); double gross=sc.nextInt (); tax=double gross * 0.14; deduct=tax+medaid+pension; net=gross-deduct; System.out.println("The deductions are"+deduct); System.out.println("The net is"+net); } } Salary.java:9: '.class' expected tax=double gross * 0.14;
Public Comments
- What the hell are you talking about!!
- This is not a problem with jGrasp (which is a Java editor) The problems are in your java code, and there are many. I won't do your homework for you, but I'll point out some places for you to look over: It should be java.util.scanner If you use the nextInt() method, you can't pass the value to a double variable There's no spaces between file names and parentheses You don't need to define gross as a double three times pension was never defined (but I think you did that and it was erased by yahoo.) Go immediately and talk to your teacher or TA. You need help. The problems are only going to get harder. You can do this, but you are currently in over your head, and you need to spend some quality time with somebody who can help you understand what's going on. Best of luck to you!
Powered by Yahoo! Answers