Aa

Text size

?

Map / ArrayList & Data / Check 2

⌨️ Write

Check: average of a file

Write average so it returns the mean of all the numbers in the file. Blank lines may appear. A file with no numbers gives 0.0.

  • Scanner
  • hasNextInt()
  • (double)
📄 temps.txt — a file the program reads
21 19
24
 
18
📄 empty.txt — a file the program reads