B 2.5.1 Worksheet Java
Instructions: Complete the following coding challenges. Remember to handle potential IOExceptions and FileNotFoundExceptions where appropriate using try-catch blocks or try-with-resources. Close your file streams when finished. 1. Word Count: Write a Java program that reads a text file (e.g., "input.txt") and counts the number of words in the file. Assume words are separated by spaces. Print the total word count to...