Overview:
This assignment introduces the elements
of C++ programming. The key challenge here is, "How do software
designers write programs for real applications, and how are they
translated (compiled) to run on a computer?" The readings and
exercises for this assignment are taken from portions of chapter 7 of
your text.
This window has two columns. On the left is a listing of the original C++ program and on the right is a copy of that listing that is checked for errors and compiled (The actual machine code doesn't appear here).
Now select Execute in the Compiler menu, and then select the Run button at the bottom. You will be prompted to enter two 4-digit numbers. This program should behave just like the pseudocode algorithm that we first saw in Figure 1.2, but now it's been rewritten in C++. You should be able to duplicate the output shown below.
Now open, compile, and run the program "fig25.cpp" in the EXAMPLES folder.
1. Describe briefly in English what this program does.
Now open, compile, and run the program "fig29.cpp" in the EXAMPLES folder.
2. Describe briefly in English what this program does.
Now open, compile, and run the program "fig210.cpp" in the EXAMPLES folder.
3. Describe briefly in English what this program does.
You may do these exercises (except the last one) either by hand or with a word processor (e.g. MS Word). Also, you may choose to do this assignment either by yourself or in a group. However, solutions should be written up individually and handed in on the due date.
To submit a file electronically, you should first rename it so that you are identified as the author (e.g., give it a name like lab-x-ltoma). Then drag the file to the csci107 -> Drop Box folder. Be careful not to drag an entire folder into the Drop Box; only a single file at a time can be submitted.
Once you are finished in the lab, be sure to drag the CS107 icon to the Trash - this step disconnects you from the server and prevents someone else (who may use this iMac later in the day) from accidentally accessing files in your personal folder.