Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CIS 1111 Programming – Unit 4

Description: For this assignment, you will use a nested loop structure to implement a customer account tracking system within your store. The system will record the customer’s first name as well as keep a record of all your customer’s orders. Remember, no hard coding. All values must be calculated using formulas.

You need to submit

ü Flowchart

ü Reflection (3-5 sentences about how you solved this assignment)

ü One set of test data that shows at least three customers and two orders per customer. (values should match your console output screenshot)

For example….

Customer Name

Order 1 Subtotal

Payment Method

# Items Purchased

Order 2 Subtotal

Payment Method

# Items Purchased

Order 3 Subtotal

Payment Method

# Items Purchased

Sally

20.50

Cash

6

13.75

Cash

4

27.25

Card

7

Sonic

45.50

Card

15

44.25

Card

11

57.75

Card

18

Sulu

20.75

Check

6

33.25

Check

9

20.50

Card

6

REMINDER: Subtotal is the cost of products ONLY. It does not include any taxes/fees/discounts etc.

Requirements:

1. Use a nested loop structure to collect data from the user, then write the data to a text file. These values cannot be written to the file with hard coding!

a. The outer loop should be a while loop that could process an unlimited number of customers, the inner loop must be a for loop (3 orders).

b. Since you do not know how many customers will be served, make sure the user can exit the loop.

c. When writing to the text file, place each new customer on a new line with a space between each of their data points. The text file that your program creates should look similar to the picture.

d. Code a cash purchase as a 1, credit card as a 2, check as a 3. Your file should look like the screenshot above.

2. After building the file, use another nested loop structure to read the data from the text file to process all transactions. Calculate the following information for a store earning report.

HINT: See “Store Formulas” table for more information on these.

· total number of items sold

· number of cash/card/check transactions

· total store sales

· average transaction amount.

3. Output must be labelled and easy to read as shown in the sample output below.

4. Program must be documented with the following:

a. // Name

b. // Date

c. // Program Name

d. // Description

Store Formulas Table

Hint: this data was accumulated across all customer transactions

Total Number of Items Sold

How many items were sold to all customers?

Number of Cash Transactions

How many transactions were cash payment?

Number of Card Transactions

How many transactions were card payment?

Number of Check Transactions

How many transactions were check payment?

Total Sales

How much (in $) was made just from product sales?

Average Transaction Amount

Sum of all order final totals / number of transactions

PROJECT HINTS:

· You will not be using all the code you have written for this project (no web orders right now). Remove all unused code, but we recommend saving it separately in a Word document.

· Accumulators & counters are your friend for this assignment! Remember to initialize them to 0.

· The outer loop processes customers (rows) and the inner loop processes the orders (columns)

· If/Else statements can be used throughout

· 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

4

Meets all stated requirements

0

37

Output is correct given the input, and the output is correctly formatted

7

The program compiles and executes without any runtime, syntax, or logic error.

0

9

Console output, .cpp file, flowchart, reflection, and test data were uploaded to the Dropbox.

0

3

Total Points

0

60

Sample Output – Inputting Customer Orders:

Sample Test Data: (this is an example, you will need to create your own test data!)