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
Computer Science & Information Technology
You might also like to view...
Impress sound options for transitions include applause, laser and a train
Indicate whether the statement is true or false
Computer Science & Information Technology
What are the animation options for SmartArt objects?
What will be an ideal response?
Computer Science & Information Technology