Question: IT 1090C Computer Programming I Prof. Tom Wulf Lab 12: File Away Fall Semester 2019-20 20 Points (No Extra or Graduate options) Objective:More practice reading
IT 1090C Computer Programming I
Prof. Tom Wulf
Lab 12: File Away
Fall Semester 2019-20
20 Points (No Extra or Graduate options)
Objective:More practice reading text files and working with String data.
Implement a java program that uses the JFileChooser dialog to let the user specify a text file on the system.The program should then open and read the file line by line.The program should then print a summary report of the file to the console (screen).The summary report should contain the following:
- The name of the file the user chose to process
- Number of lines in the file
- Number of words in the file
- Number of characters in the file
Suggested process:
Open the file after the user specifies it with JFileChooser.Read each line one at a time keeping track of how many lines you read.As you read each line, count how many words there are. N spaces suggests that there are N + 1 word on the line assuming no doubled spaces. You can also use the split function to return an array of the words and the length of the array is how many words there are.This works better than just counting the spaces...)Finally, as you read each line use the String length property to count how many characters are in the line and keep track of the total length of the file.
Get a screenshot that shows the JFileChooser running.
Get a screenshot that shows your output stats for a successful program run.
Submit your work:
Rename this word doc as Lastname_Firstname_Lab12 File Away.docx.Zip it all up with a complete copy of your Netbeans project.Name the Zip file: Lastname_Firstname_Lab12 File Away.zip.Submit your file archive with the Canvas assignment mechanism.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
