CSCE 2004 - Homework 4
Due: Friday, Mar. 7, 11:59 PM Extended until: Sunday, Mar. 9, 11:59 PM

The objective of this programming assignment is to become familiar with calling C++ functions. You will be modifying an existing program: hw4.cpp You may view this program from the following link:

hw4.cpp
You may copy the program to your turing account by: cp /home/sgauch/public_html/2004/S14/hw/hw4.cpp .

You may run a sample solution on turing by typing ~sgauch/public_html/2004/S14/hw/hw4.exe

Problem Statement
Your task is to write a main program to accomplish certain goals by caling functions that are already written and provided to you.

The Walton Arts Center offers its event participant an assortment of tickets to fit different budgets. The WAC offers three kinds of tickets: Balcony, Orchestra and Box seats.

  • Balcony tickets are the cheapest because the tickets are located the furthest from stage. You can purchase any number of tickets.

  • Orchestra tickets are more expensive because they are closer to the stage.

  • Box seat tickets are the most expensive because they offer premium seats and privacy. Box seat holders of purchaing a premium package that includes a souvenir and free refreshments.
  • Participants can purchase more than one type of ticket at a time, as many of each as they choose. They are also given the option of purchasing parking passes to the parking lot next to the center at a discounted price.

    Your goal is to write a program that sells the tickets and parking passes to a patron using the existing functions in hw4.cpp

    Design:
    Once you have an idea of what needs to be done, think about how you can use the provided functions in your main() function, which actual parameters need to be passed to the functions, the type of parameters that are being used and how you can use the return values. A skeleton of the main program is included with comments showing the necessary steps where work needs to be provided. The necessary variables for your program are already declared, therefore all you need to do is use them in your work. DO NOT CHANGE THE FUNCTIONS THEMSELVES !!! You just need to create a main program that uses them. If you feel you need extra variables in the main program, you may add them, but they should not be necessary.

    Implementation:
    The first thing your program should do is echo your name and UAID to the screen so that your executable, when run, tells us who wrote the program. You should also include your name and UAID in the comments at the top of the program.

    Next the program should show the user the seats available and allow them to purchase some tickets.

    The program calculate the price for the tickets. If the user has purchased Box seats, they should be offered the premium package.

    Next, ask the user whether or not they want to purchase more tickets and have them answer Y or N. If they do, loop back to the top and repeat.

    When the user is done buying tickets, they are asked if they want any parking passes. Any parking passes purchased are added to the grand total, and the total amount due is displayed to the participant.

    You are required to call each of the provided functions at least once. Hint: a do-while with a switch inside is probably easiest, but you can write the main program using any C++ statements.

    3 . Testing:

    Test your program to check that it operates correctly for all of the requirements listed above. Also check for the error handling capabilities of the code. Try your program on various input values, and save your testing output for inclusion in your project report (5. Documentation section) below. Run your program at least three times. Be sure to show examples of what happens when player enters invalid data.

    4 . Documentation:

    When you have completed your C++ program, write a short report (less than one page long) describing what the objectives were, what you did, and the status of the program. Does it work properly for all test cases? Did you find this project interesting? Are there any known problems? What would you add to improve the functionality of your program.

    Add your testing as an appendix at the bottom of the report.

    Save this report in a text or pdf file.

    5. Project Submission:

    In this class, we will be using electronic project submission to make sure that all students hand their programming projects on time. When you have completed the tasks above go to the Homeworks tab on the course's Blackboard web site to "upload" your report (a single pdf or txt file), and your C++ program (a single cpp or txt file). Do NOT upload an executable version of your program. To upload , simply scroll down all the way down to the end of Homework description, then click on "Browse My computer" and attach your files one at a time. Do not write any other text in "comment" section or by clicking "write submission" button. After you attached the files, click on "Submit" button. You are allowed to submit more than once; only the last sumitted homework will be graded.

    Every student should UPLOAD two (2) files:

    1) TA_StudentID_code.txt - This is your source code (.cpp) file. Do not use any Word processor or WordPad as they automatically add extra characters to your code that causes it not to compile. You can use TextPad or NotePad in Windows; nano or any text editor on linux; TextEdit on Mac (select Plain Text under preferences, save as ASCII)

    2) TA_StudentID_report.pdf or TA_StudentID_report.txt
    There is a 10% penalty for not uploading the right formats and not naming the files correctly. For example, if your StudentID is 010590222 and your TA is Eugene, you should upload two files: Eugene_010590222_code.txt and Eugene_010590222_report.pdf.

    The TA names are Alborz, Alex, Eugene

    The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit:

    ● 10% off if less than 1 day late,

    ● 20% off if less than 2 days late,

    ● 30% off if less than 3 days late,

    ● no credit if more than 3 days late.

    You will receive partial credit for all programs that compile even if they do not meet all program requirements, so handing projects in on time is highly recommended. Programs that do not compile on turing will receive an automatic deduction of 60%.

    Academic Integrity This assigment is to be done individually. All code must be written by the student doing the submission.