Print Name __________________________
Signature __________________________
Print Name __________________________
Signature __________________________
First Programs Lab
Individual/Team (1-2) Assignment
15 Points
using namespace std;
Skip the books comments! Each and every program file that you do this
semester must include a documentation box at the top.
Make the documentation box 75-80 characters wide. Do not use the tab key in the
documentation box. Use the following format.
| ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// // Greetings.cpp // // // // Purpose : Display Hello World. // // // // Written By : Your Name(s) Environment : Red Hat Linux // // Date : xx/xx/xx Compiler : g++ // ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// |
2] Always make sure that the braces {} are lined up in pairs.
3] Always indent the code within each module, including main.
4]
Program 2.1 should look like the following when finished.
| ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// // Greetings.cpp // // // // Purpose : Display Hello World. // // // // Written By : Your Name(s) Environment : Red Hat Linux // // Date : xx/xx/xx Compiler : g++ // ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// # include <iostream.h> int main( ) |
3] Compile the program to produce the executable/binary a.out file!
g++ Greetings1.cpp
4] Execute the program.
a.out
If there are errors, correct them and recompile [ step 3].
5] The program works! Start a Windows 2000/NT/98/95/Me/XP
system that has Visual Studio. Print it from within
windows using Visual C++. Print this and every other
program that you turn in this semester with a left margin to 1" and a right margin to .5". Make the font
New Courier 8.
Visual
C++ Printing: Page SetUp & Font Selection
6] Do Steps 1-5 for Program 2.2. Call it SalesTax.cpp
7] Do Steps 1-5 for Program 2.3. Call it Greetings2.cpp
8] Do Steps 1-5 for Program 2.4. Call it Greetings3.cpp Include the book's comments/documentation!
9] Do Steps 1-5 for Program 2.5. Call it Greetings4.cpp Include the book's comments/documentation!
10] Do Steps 1-5 for Program 2.6. Call it ComputeY.cpp Do not include any of the books comments. Select good variables for all. Use X, Y, and Slope as opposed to x, y, m!
11]
From within Windows, copy files Greetings1.cpp,
SalesTax.cpp, Greetings2.cpp,
Greetings3.cpp, Greetings4.cpp,
ComputeY.cpp to a floppy
disk. Copy files Greetings1.cpp,
SalesTax.cpp, Greetings2.cpp,
Greetings3.cpp, Greetings4.cpp,
ComputeY.cpp to a
second floppy
disk.
A] Divider
B] Copy of this assignment sheet. Using an ink pen, print your name and sign this lab at the top.
C] Listings Greetings1.cpp, SalesTax.cpp, Greetings2.cpp, Greetings3.cpp, Greetings4.cpp, ComputeY.cpp
D] Disk containing the files.