|
Why must the part throws IOException be used? A good answer might be:This informs the compiler to prepared for an input operation that might fail. | |
A Story ProblemSay that you want to write a program that calculates the total bill for a restaurant meal. The input to the program will be the basic cost of the meal. To this is added 6% sales tax and a 20% tip on the before-tax cost. Arithmetic will be done with type double. Here is the program, with some parts left out:
These are the missing parts, but not in order:
(basicCost + basicCost*0.06 + basicCost*0.20)
System.out.println("Enter the basic cost:");
basicCost = Double.parseDouble( charData ) ;
BufferedReader stdin
= new BufferedReader(
new InputStreamReader( System.in ) );
charData = stdin.readLine();
throws IOException
| |
QUESTION 6:Fill in the missing parts. Click Here after you have answered the question |