Your assignment is to write a complete program that will:
- Read a file named fileList.txt
- Consisting of:
- A list of files
- For each of the files in fileList.txt
- Determine if it exists
- If it exists, Process the file contents
- Determine and Capture the name of the file
- Determine and Capture the callers name(s) if available
- Determine and Capture the callers phone number(s)
- Determine and Capture the time and date of the text message
- Determine and Capture the text message
- All files created shall be created in the workspace
- All files read shall be in the workspace
- Write the formatted output to the console
- Write the formatted output to a single output file name NSA.txt
- The absolute path shall be the first line of output for both the console and the NSA.txt file followed by a single blank line.
- The format for each output must be:
- If it exists, Process the file contents
- Determine if it exists
- Consisting of:
The Absolute path
Name of file being processed
Caller Name 1: name goes here or unknown
Caller Name 2: other name goes here or unknown
Caller Number 1: xxx-xxx-xxxx or unknown
Caller Number 2: xxx-xxx-xxxx or unknown
Date: YYYY/MM/ DD
Time: hh:mm: ss
Text message goes here
Where xxx is three digits and xxxx is four digits
Where YYYY is the four digit year,
Where MM is the two digit month
Where DD is the two digit day
Where hh is the two digit hour
Where mm is the two digit minute
Where ss is the two digit second
- If the file does not exist
- Write to the console and the NSA.txt file the following:
File: FN.FT not found
Where FN is the file name and FT is the file extension
Learning Objective:
Show that you know how to use the Scanner and PrintStream classes along with the FileNotFoundException to process files without violating the concepts of good coding. Also to know how to use the relative and absolute path options. (This will be considered as part of the grading)
Limitations and grading criteria:
- You may not sort any of the files.
- You may not alter any of the data in the input files.
- You may not use anything that has not been taught to date.
- You may not use any code that you get from other sources.
- Your program must be general enough to handle any input meeting the specified criteria. In other words, do not write the program for a specific data file, but for a general case.
- You must determine the input file format from the files provided
- If your program does not execute your points will be greatly reduced
- You may not use recursion
- Do not use Global or class level variables
- If an input value is missing, you must indicate that by printing unknown in its place.
Your program will be graded on the following concepts:
- Methods
- Good cohesion
- No coupling
- No chaining
- Robustness
- Accepts specified input
- Rejects bad input without terminating the program
- IO
- Use of Scanner
- Use of PrintStream
- Looping and Boolean logic
- Logic
- Termination
- priming
- Correct output
- Values
- format
- Algorithm development
- Proper documentation
- JavaDoc class
- JavaDoc methods
- Comments within code
Reviews
There are no reviews yet.