$29
Your mission, if you choose to accept it, is to write a program that will read numbers from a text file, add a value to each number, convert each number into a String, and then write the String to a binary file. However, the forces of darkness do not want the program to succeed and will do everything in their power to cause the program to crash before finishing its task. In addition to writing code that will read numbers from a text file, add a value, and write the numbers as Strings to a binary file, you will need to consider what might cause the program to crash and handle any exceptions that might be thrown.
Requirements
If your code does not compile, you will receive a score of 0. It is YOUR responsibility to come see ME for help if you need it.
(1 point) The source code file must be named IntConverter.java.
(1 point) Include a proper Javadoc comment at the top of your program that includes a description of the program and also includes your name.
(1 point) Use comments in the program to document the code. Comments should add to the code, not make the code hard to read.
Your program should:
(2 points) Read the name of a text file (not a binary file) from the user that contains integers and open the file for reading.
(1 point) Ask the user for an integer number that will be added to each number in the text file.
(10 points) Read in each integer from the file, add the user number to each, convert each integer individually to a String, and write each individual String to a binary file (not a text file) named “output.txt”.
(2 points) When a program is working behind the scenes, the user could assume the program is not doing anything. For this program, when the program starts the process of reading, converting, and writing, indicate this to the user. Also indicate to the user when the program has finished.
(15 points) In addition to the requirements above, your program must handle and recover from any exceptions, meaning that even if exceptions are thrown, the program still completes its entire task. You will lose 5 points for each unhandled exception that crashes your program up to a maximum of 15 points.
(2 points) Use good programming practices throughout the code (variable names are descriptive and follow variable naming conventions, properly indent different parts of the code, vertically line up curly braces or headers, lines of code are not longer than 80 characters, etc.).
Submit the source file in Blackboard
Log into Blackboard and go to our course page. Under Content in the left menu, open the folder for the Programming Assignments. Click on the link for Program 6. Under Assignment Submission, use Browse My Computer next to Attach File and find the .java file. Only submit the .java file! When the file has been attached, click the Submit button.