In C++ only please! 24.25 LAB*: Program: Self-pay kiosk
Program Specifications: Write a SelfPayKiosk class to support basic operations such as scan item, cancel transaction, checkout, and make payment. SelfPayKiosk.h declares the functions necessary to complete the exercise. SelfPayKiosk.cpp provides the function stubs. Follow each step to gradually complete all functions in SelfPayKiosk.cpp.
Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. main() in main.cpp includes basic function calls. Add statements as functions are completed to support development mode testing.
Step 0: In SelfPayKiosk.h, declare private data members for the number of customers served (int), total sales (double), and current amount due (double). Note the provided constant variable for sales tax of 7%.
Step 1 (1 pt): 1) Complete the constructor to initialize all data members to zero. 2) Complete the accessor functions to return the number of customers served, total sales, and current amount due. Submit for grading to confirm 1 test passes.
Step 2 (2 pts): Complete the ScanItem() function. Increase the amount due by the parameter price. Do not update the amount due if the parameter price is negative. Submit for grading to confirm 3 tests pass.
Step 3 (1 pt): Complete the CheckOut() function. Multiply the amount due by SALES_TAX and add it to the amount due. Submit for grading to confirm 4 tests pass.
Step 4 (2 pts): Complete the MakePayment() function. If the parameter payment is enough to pay the amount due, increase total sales by the amount due, increment the number of customers served, and reset the amount due to zero in preparation for the next customer. However, if the parameter payment is not enough, update total sales by the payment and reduce the amount due by the payment. Do not make any changes if the parameter payment is negative. Submit for grading to confirm 6 tests pass.
Step 5 (1 pt): 1) Complete the ResetKiosk() function to reset all data members to zero. 2) Complete the CancelTransaction() function to reset the amount due to zero. Submit for grading to confirm 7 tests pass.
Step 6 (2 pts): Complete the SimulateSales() function to perform multiple transactions with increasing prices. Use a loop to simulate the parameter numSales transactions. Within the loop, call ScanItem() with the parameter initialPrice. Call CheckOut() and MakePayment() to make a payment of $1 more than the amount due. Finally, increase the item price by the parameter incrPrice in preparation for the next transaction. Submit for grading to confirm 8 tests pass.
Step 7 (1 pt): Add a boolean data member to indicate if the customer has checked out and is ready to make a payment. Only allow payment after the customer has checked out. The CancelTransaction() function should not reset the amount due if the customer has checked out. Update the following functions by inserting assignment statements and if statements related to the new data member: constructor, CheckOut(), MakePayment(), and CancelTransaction(). For example, set the boolean data member to false only after full payment has been made. Submit for grading to confirm all tests pass.