Question: 1. (InputMismatchException) Write a program that prompts the user to read two integers and displays their sum. Your program should prompt the user to read
1. (InputMismatchException) Write a program that prompts the user to read two integers and displays their sum. Your program should prompt the user to read the number again if the input is incorrect.
2. (Count characters, words, and lines in a file) Write a program that will count the number of characters, words, and lines in a file. Words are separated by whitespace characters. The file name should be passed as a command-line argument, as shown in Figure 12.13.
FIGURE 12.13 The program displays the number of characters, words, and lines in the given file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
