CS 172 Lab 2: Debugging Compilation Errors
This is a lab exercise to help you learn how to find and fix
compilation errors in your Ada programs. It is recommended that you
familiarize yourself with pages 48-79 in the textbook before you
attempt this lab.
- Launch Windows Explorer. You should always have Explorer
running when you program, to keep track of your files.
View your Y:\Ada subdirectory.
- Shift-click the following link:
CalcTemp.adb
Save the file as Y:\Ada\CalcTemp.adb
View the directory
listing in Windows Explorer to confirm that the file is now in
your Y:\Ada subdirectory.
- Launch AdaGIDE. Open the file you just created,
Y:\Ada\CalcTemp.adb.
- This file is supposed to be similar to the program on page 74-75
of your book (except that some identifier names are
changed). However, it has some errors. Press F2 (or the compile
icon) to compile the code. Note that the compiler generates 2
error messages. Read them very carefully, and see if you can
figure out what they mean. Compare the code to the program
listing in the book. Click on each of the error messages to see
the line of code in question.
- The program has exactly 6 errors, but initially the compiler only lists 2
errors. Some of the compiler error messages are clearer than
others. As you start fixing some errors, the compiler will start
finding other errors.
- Your assignment:
- Correct the six errors in the program. Create an error-free
program listing, and a program run.
- In a text document, explain in words what the six errors were,
on which lines of the source code each appeared, and how you fixed
each one.
- Bring me a printout of the corrected program listing and a printout of the text document.