The full program is below:
Here is the complete program. Hopefully you figured out the proper order for the lines. You should be able to read the program line by line, almost like a story.
import java.util.Scanner;
public class RestaurantBill
{
public static void main (String[] args)
{
Scanner scan = new Scanner( System.in );
double basicCost;
System.out.print("Enter the basic cost: ");
basicCost = scan.nextDouble();
System.out.println("basic cost: " + basicCost + " total cost: " +
(basicCost + basicCost*0.06 + basicCost*0.20) );
}
}
As you read the story (the program) it should make sense. Actions should follow in a logical order. The logic is the important part, not the fussy details of syntax.
Some big programming projects have failed badly, costing billions of dollars. What do you suppose happened?