Problem Set 8
Up Problem Set 0 Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Problem Set 6 Problem Set 7 Problem Set 8 Problem Set 9 Problem Set 10

 

Exception Handling and Input/Output

Due 11:59pm on Wednesday, November 15

 

Do Program Design Exercise 18 in Chapter 11.  Please take note of the following:

bullet

The problem asks you to "Enter the file names to read from and write to as program arguments".  This means that you should develop and compile your program as a "Console Application" in VS.NET, but instead of running it using VS.NET, you should run it "stand alone", as follows:
 
Suppose the name of your Project is PS8_Q1.  You should open a "Command Prompt" from the Start Menu, and then, using the "cd" command, navigate your way to "Visual Studio Projects\PS8_Q1\bin\Debug".  In this folder you should see a file "PS8_Q1.exe".  You can now run this file with command-line arguments by typing "PS8_Q1 filename1 filename2", where "filename1" and "filename2" are the names of the two files.  Section 11.1 explains how to access these program arguments from your program.
 

bullet

Your program should use exception handling to recover gracefully from IO errors, such as when the input file does not exist.
 

bullet

I would recommend first writing your program to read from the first file and write the same information to the second file.  Then you can add the required functionality after you have debugged the basic input/output.

 Solution.