go to previous page   go to home page   go to next page hear noise highlighting

Answer:

The full program is below:


Full Restaurant Program

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.


QUESTION 9:

Some big programming projects have failed badly, costing billions of dollars. What do you suppose happened?


go to previous page   go to home page   go to next page