ITP-100 Software Design Lab 2: Documentation & Formatting Due Date: January 22, 2008
Name: _____________________________________ (has neither given nor received aid on this program)
Purpose: The purpose of this lab is twofold: First, to familiarize our students with documentation (specifically Print Spacing Charts and IPO Charts) and second, to allow formatting for literal and numeric outputs. These two purposes complement each other, in that programmers need a guide to follow for spacing. This relatively simple program offers students a great example to demonstrate the practical use of this documentation. Directions: 1. Download the program Lab2.cpp from the instructor’s website www.jeffgold.net. Add your name and date programmed to this program where specified. Note that the program compiles properly and calculates the correct numeric answers: the weekly pay increase and the new weekly salary. 2. Create your own Print Spacing Chart exactly like your instructor’s, only put your name and your date written on the chart you have prepared. Use the chart for spacing in step 3, below. 3. Using techniques learned in class determine the value of n for each field width in your program: setw(n). Keep in mind that these fields are always right justified, since this is the default setting. A left justified setting could also be programmed, however, in this program for simplification we use default right justification setting. 4. When finished and your screen output looks identical to the Print Spacing Chart’s (horizontal and vertical spacing), save your source code to a file called Lab2.cpp and copy/paste your DOS output to a file called Lab2out.txt 5. Before our next class send these two files to me via the TCC email account: tcgoldj@tcc.edu. Attach both files to your email message and put Lab2 as the subject of the email. Again, I’ll acknowledge receipt with my reply message. Checklist for Turn-in: This signed specification sheet Lab2.cpp source code (hard copy) Lab2out.txt output file created by copy/paste (hard copy) Print Spacing Chart that you re-typed in Notepad IPO Chart with flowchart similar to p. 45 in your textbook. (Easy, since my program comments were taken from these flowchart instructions) F. Answer these questions: 1. What are the two types of C++ comments in this program? 2. What are the keystrokes used for each comment? 3. In the acronym IPO what does each letter represent? 4. Why use long names for these double precision variables? Please, do not hesitate to seek my help (early, if necessary) in this lab assignment. A. B. C. D. E.