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

Answer:

Of course.


Improved Restaurant Program

Perhaps we should practice programming logic a little before those billion dollar failures start mounting up. Modify the program so the user enters cost of the meal and the percentage for the tip. (The tax rate remains the same.) Then calculate and print the total cost.


This time, there are no blanks to fill. Your job is to figure out how to change the program by inserting the following statements and parts of statements (not given in order). Do this by copying and pasting.


basicCost*tipPercent

System.out.print("Enter the tip percentage: ");

double tipPercent;

tipPercent = scan.nextDouble();

If you want, you can copy and paste the program into a text editor and save to a file which you can then compile and run.


QUESTION 10:

Copy and Paste (control-C and control-V) the suggested statements into the program, and edit a few other statements.


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