Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
public static double compute(Scanner sc) throws Exceptionof the class Mystery. You can get Mystery.class with:
Here are some sample runs:
~/$ java HW1
23 12 17
8 -12
2 5 8
57.637144696875005 |
~/$ java HW1
23 12
17 the 8
Error bad input string "the" |
~/$ java HW1
12
0
18 13
34.2 89
Error bad input string "34.2" |
~/$ java HW1 23 12 17 8 -12 2 5 8 ← ctrl-d to signal end of input 57.637144696875005 |
~/$ java HW1
23 12
17 the 8
Error bad input string "the" at line 2 |
|
~/$ java HW1 ina.txt
57.637144696875005 |
~/$ java HW1 xyz.txt
File "xyz.txt" not found |
~/$ java HW1 inb.txt
Error bad input string "the" at line 2 |
submit -c=IC211 -p=hw17 HW1.java