
Lesson 4-5: Debugging
Program Input and the Software Design Process | 91
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Program FourVals reads four int values from a file and writes them out with exactly
one blank between them. The program doesn’t even compile! Correct the syntax errors and run the
program. Show your output.
Exercise 2: Now the program runs, but the output does not meet its specifications. Describe this
logic error, correct it, and rerun the program. Show your output.
Exercise 3: Run your program, using file Four2Val.in. Describe what happens. ...