Hello everyone,
I need to write a simple program. After I input the cost of an entree, drink, and dessert, it should calculate the cost of a meal and its tax. However, when I compile my code, I get three errors. Can you tell me what's wrong and how I can fix it?
Here are the errors I get:
foodcalc.java:1: error: ';' expected
import java.io.*
^
foodcalc.java:2: error: ';' expected
import java.util.Scanner
^
foodcalc.java:13: error: ';' expected
systemout.println ("Enter price of dessert")
^
3 errors
_______________________
And here is my code:
import java.io.* import java.util.Scanner public class foodcalc { public static void main (String [] args) { Scanner input = new Scanner (System.in); systemout.println ("Enter price of entree"); double entreeCost = input.nextdouble (); systemout.println ("Enter price of drink"); double drinkCost = input.nextdouble (); systemout.println ("Enter price of dessert") double dessertCost = input.nextdouble (); double foodCost = entreeCost + drinkCost + dessertCost; double taxAmt = foodCost * 0.10 ; System.out.println ("Total cost is $ " + (int)(mealCost * 100 /100.0)); } }