CIS 1111 Programming – Unit 2
Description: For the second phase of your store build, you will add functionality that allows the customer to order your store’s products online and have them shipped to their home. Collect the number of items the customer wants to purchase and the number of miles the products will need to be shipped so that you can calculate and display shipping cost. To drum up more business, the store is offering a random discount on shipping fees.
You will also need to create a flowchart and two sets of test data for this program. The test data values should match your console output screenshot.
Requirements:
- Variable names must be descriptive, self-documenting and conform to proper naming conventions.
- Collect the customer’s full name and shipping address using getline().
- Collect from the customer which items they would like to purchase and how many of each item.
- Collect from the customer how many miles away they are from your store. Distance and package weight will be used to calculate shipping cost.
- Create variables to store the weight of each of your products. Weight will be stored in ounces but converted to pounds to calculate shipping costs. (1 lb = 16 oz. ). Round the weight up to the next highest pound using the ceil() function.
- Shipping cost is a flat rate of $.45 per mile, and $2.65 per pound. These values are constant.
- Calculate the shipping cost before the discount is subtracted.
- Generate a random number between 1 and 10. Divide that number by 100 to get the random percentage discount. The dollar amount of the discount is the percentage multiplied by the subtotal.
- You may use additional variables as needed.
- You must display values by using cout to call your variables – no hard coding or literal values!
- Display the total and an itemized shipping cost to the customer: distance, pound cost and ounce overage cost (see output screenshot).
- Output must be labeled and easy to read – decimals should all line up as shown in the output below.
- Program must be documented with:
- //Name
- //Date
- //Program Description
- //Description
Grading guidelines for this assignment
| Range – Low End
(Did not do or did very little effort) |
Range – High End
(Used correctly and spent time/effort on programming) |
|
| Names of variables are meaningful and the program comments self-document the program. | 0 | 2 |
| Meets all stated requirements | 0 | 10 |
| Output is correct given the input, and the output is correctly formatted | 4 | |
| The program compiles and executes without any runtime, syntax, or logic error. | 0 | 3 |
| Console output, .cpp file, flowchart and test data was all uploaded to the Dropbox. | 0 | 1 |
| Total Points | 0 | 20 |
Sample Output:
Sample Test Data: (this is an example, you will need to create your own test data!)