What will be the value of totalIncome after the following values are read from the file?
2.5
8.5
3.0
5.5
abc
1.0
```
In the following code, assume that inputFile references a Scanner object that has been successfully used to open a file:
double totalIncome = 0.0;
while (inputFile.hasNext())
{
try
{
totalIncome += inputFile.nextDouble();
}
catch(InputMismatchException e)
{
System.out.println("Non-numeric data encountered " +
"in the file.");
inputFile.nextLine();
}
finally
{
totalIncome = 35.5;
}
}
```
a. 19.5. b. 0.0 c. 35.5 d. 75.0
c. 35.5
You might also like to view...
A hacker uses his technical expertise to gain unauthorized access to a computer
Indicate whether the statement is true or false
Choose the correct pronoun in the following sentence.Each of the comets has _________ own orbit.?
A. ?its B. ?their
A technician is having problems sending a notification from a server. The technician suspects the firewall may be blocking traffic. Which of the following clients can be used to confirm the technician's suspicions?
A. traceroute B. sendmail C. nslookup D. telnet
In the accompanying figure, item A is used for which of the following:
A. To view pages in the publication B. To create thumbnails of existing pages C. To view pages side-by-side D. To add articles to a multipage document