Testing

Make sure you pass the students.txt file name as a command line argument using the "Open run dialogue," as demonstrated here.

Your output should be:

The number of students is: 3
Student name = John and id = 10
Student name = Mike and id = 20
Student name = Steve and id = 30

In addition, test the program under the following cases.

  • The command line argument specifies a file that does not exist.
  • There are no command line arguments.