CIS-113 INTRODUCTION TO PROGRAMMING LOGIC 2008

USING THE C++ LANGUAGE

PROJECT # 3 (25 points)

********************************************************

* *

* *

* Have your materials available in a folder on the due date. *

* *

********************************************************

Program # 3 is an extension of program # 2. This project will build on your last set of code. Make a copy of Program # 2 and "save as" Program # 3.

New concepts in Program # 3 include the use of a "while loop" in processing input data from a disk instead of from the keyboard. In addition, we will use a series of if statements to determine the dealer profit for each input record. A sample of the output is included. Your output does not have to look exactly like the sample but it should include all of the basic information.

As in Program # 2, after you have entered your source code, compile it to make certain there are no syntax errors. If syntax errors occur, and remember they will, they need to be corrected before you resubmit your program. Do this over and over again until you get a "clean compile". ("COMPILE SUCCESSFUL").

When your program is properly compiled, run your program to see whether your output is correct. Because the input for the program is on disk, you must obtain a copy of the input file from me in lab.

(The name of the input file is "compdata.txt").

After you have executed (run) your program, you need to hand in the following items in your folder:

(1) a listing of your source code (right side)

(2) the results of your program (right side)

(3) your data dictionary

(4) pseudocode (or a program flowchart)

(5) a print spacing chart

(6) hand calculations

CIS-113 (“C++”)

Program # 3

PROGRAM SPECIFICATIONS

INPUT:

The INPUT RECORD layout for Program # 3 is listed below:

______

COMPUTER NAME RETAIL PRICE AMOUNT CUSTOMER PAID

______

COMPUTER NAME is a 13 character string

RETAIL PRICE is a floating point decimal

AMOUNT CUSTOMER PAID is a floating point decimal

FORMULAS:

In addition to your input data, there are several "formulas" that you must include in your source code to produce the "Summary Report". They are as follows:

DEALER COST = RETAIL PRICE x 70%

DEALER PROFIT = AMOUNT CUSTOMER PAID - DEALER COST

** COMMISSION = DEALER PROFIT x A SET % BASED ON DEALER PROFIT

TOTAL COMMISSION = TOTAL COMMISSION + COMMISSION

TOTAL NUMBER OF COMPUTERS SOLD = TOTAL NUMBER OF COMPUTERS SOLD + 1

** Note: If the dealer profit is greater than 300.00, then the commission rate is 45%.

If the dealer profit is greater than 200.00, then the commission rate is 35%.

If the dealer profit is 200.00 or less, then the commission rate is 25%.

CONSTRAINTS:

After you open your input file, you will need to test to make certain that the data is on drive A: (or your current drive) and that the name of the file is spelled correctly. If the file can not be found, display a message that states "There is a problem locating the input file". More importantly "exit" the program - do not go on since executing your program without data makes no sense!!

CIS-113 ("C++")

Program # 3

OUTPUT:

Listed below is a sample of what your screen may look like as you execute (run) your program.

PGCC COMPUTER CENTER

------

SALESPERSON: PUT YOUR NAME HERE

------

MODEL MSRP CUSTOMER COST DEALER PROFIT COMMISSION

------

XXXXXXXXX nnnn.nn nnnn.nn nnnn.nn nnn.nn

XXXXXXXXX nnnn.nn nnnn.nn nnnn.nn nnn.nn

XXXXXXXXX nnnn.nn nnnn.nn nnnn.nn nnn.nn

XXXXXXXXX nnnn.nn nnnn.nn nnnn.nn nnn.nn

XXXXXXXXX nnnn.nn nnnn.nn nnnn.nn nnn.nn

XXXXXXXXX nnnn.nn nnnn.nn nnnn.nn nnn.nn

XXXXXXXXX nnnn.nn nnnn.nn nnnn.nn nnn.nn

REPORT SUMMARY

TOTAL NUMBER OF COMPUTERS SOLD FOR JANUARY 2008 : nn

TOTAL COMMISSIONS FOR PUT YOUR NAME HERE : $ nnnn.nn