Date: Thursday, January 22, 2004.
Ex. 1. a. Download the file
lab2a.cpp
that we have seen in class. Do not open it and save it from the
file menu. Right click on the link and choose "Save Target As"
instead. Save it on your m: drive under the folder that you have
created for the class.
b. The goal is to compile and execute this program. For this, you have to create a project named lab2 and save it under Documents and Settings/ your username. Open the file you have saved and include it in the project. Now you can compile it.
c. At compilation, you will find several errors; locate every error by double-clicking on it and correct them (ask for help if you can't). When you have corrected every error, you'll be able to execute the program. Copy the output and include it as a comment at the end of the file.
Ex. 2. a. Save the file under the name lab2b.cpp. Make sure that the project now contains the file with the new name. b. Modify the program to do the reverse transformation. For this, input the size of a person in feet and inches (note that you need to input 2 values), convert it into centimeters, and write out the result. Use the following formulas:
1ft = 30 cm,
1 in = 2.5 cm.
Make sure to include the output of this program at the end of the code as a comment.
Send me: the two source files, lab2a.cpp (modified by you) and lab2b.cpp.