Program description: Write a Java program name word.java toread the input from a
ID: 3610655 • Letter: P
Question
Program description:
Write a Java program name word.java toread the input from a file and output the results toboth an output file and the screen.The input file name must be supplied by theuser and the output file must be namedoutput.txt, to be supplied inside of yourprogram as part of the code, i.e. it is "built in" inside of theprogram.
Requirements:
<!--[if !supportLists]-->1. <!--[endif]-->The program must test to see if the files areopened. If not successful upon opening the files, it must print thefollowing message and terminate then program.
C:java word [PressENTER]
The file you entered either do not exist or the name is spelledwrong. Goodbye!
<!--[if !supportLists]-->2. <!--[endif]-->After opening both input file and output filesuccessfully, the program will do the following with the data thatis in the input file.
f. Count the number ofcharacters (alphanumeric).
g. Count the number ofpunctuations.
<!--[if !supportLists]-->3. <!--[endif]-->Output all of these values both on the screenand in the output file.