Description
Shirt Sales
Write a program that can be used to order a shirt from a SDSU T-shirt vendor. Your program should store the following data about the vendor’s menu in a structure:
Field Name | Description |
name | string |
cost | float/double |
qty | 5 element int array with qty for each size |
Use an enumerated type for the size that contains the following enumerators: S, M, L, XL, XXL
The program should create an array of 5 structures and initialize the cost and name fields with the data from the shirts.txt file posted in the Program 5 drop box in D2L. Set the qty fields to 0 when you read the file.
Then enter a loop, which
- Prints the menu in a numbered table with columns for the name, cost, and qty for each size. Use an additional column for the total (cost*qty) for each item and print the order total at the bottom of the total column.
- Include a choice to “Checkout”, which prints the bill with tax. Assume the tax rate is 6.5%. After printing the bill, loop back to re-display the menu with the quantities reset to 0 to take the next order.
- A third choice should allow the user to Exit the program.
Use separate functions to read the file, print the menu and print the bill. Your output should be well-organized, neat, and easy to read.
Design your program by completing the CS 250 Program Design Document. Be sure to include a structure chart for the program, the prototype for each function, a brief description of what each function does and time estimates for program design, coding each function, program testing, and total time.
Save the design in a file named ShirtsDesign_xxx.doc where xxx are your initials. Submit your program design in the Program 5 Design drop box by the due date shown in the D2L calendar.
Write your program and save it in a file named shirts_xxx.cpp where xxx are your initials. Compile, run and test your program.
Update your Program Design Document, adding the final time spent on each part of the program. Submit your final Program Design document and working .cpp file in the Program 5 drop box by the date shown in the calendar and drop box tools.