Question
FOR PYTHON Pearl's Pancake Pad is a growing restaurant business, and they'd like to upgrade their existing pen-and-paper system for tracking tickets to a digital
FOR PYTHON
Pearl's Pancake Pad is a growing restaurant business, and they'd like to upgrade their existing pen-and-paper system for tracking tickets to a digital point of sale system. They are asking you to design and build that point of sale program for them.
The point of sale program must:
- Allow the waitstaff to input the table number, and the number of diners at this table. Each table can seat up to 4 diners.
- For each diner,
- Display a menu of at least 7 common breakfast items, including types of drinks and entrees, with prices displayed. The menu is small, but the quality is high!
- Allow the waitstaff to enter the items the diner has ordered. Each diner may order as many items as they want.
- After all diners at this table have ordered, display the before tax total and total with tax for the entire table (sales tax is 8%). Also, display the suggested tip amounts for 10%, 15%, 20% and 25% service qualities.
- After a table is complete, the program should restart at the beginning, and continue until the manager selects quit. Before the program exits, it should report the total amount of money that should be in the register (ticket totals + tax for the entire day).
Design Details
Below, you are given some problem analysis and design details. You may find these helpful, and you are free to base your implementation on these details. Note that these details may not be complete. Feel free to add to or make changes to any of these details.
Problem Definition
- Problem Description:
Design and write a program that will allow a waitperson to take orders for each table, and calculate and display the per-person total, per-table total, recommended tip amounts,and overall daily total.
- List of Program Inputs:
- Table number
- Number of diners at table
- Menu item ordered by a diner
- List of Program Outputs:
- Menu of food items
- Before tax total for a table of diners
- After tax total for a table of diners
- Suggested tip amounts for a table
- After tax grand total for the day
Algorithm Outline
For each table of customers
Get the table number
Get the number of diners at this table
For each diner at this table
Display menu of food items
Get items ordered by this diner
Calculate before tax total of this diner's order
Calculate before tax total for the table
Calculate after tax total for this table
Calculate the suggested tip amounts for this table
Display the after tax total for this table
Display the suggested tip amounts for this table and the grand total for the table
Display the total sales (after tax) for the day
Structure Summary
- Functions: List of Functions (with name, parameters, and return value description):
- Name: get_table_number
Parameters:
Returns: a table number (as an int)
Description: Prompts user to enter a table number; collects and returns the user's input (as an int).
-
- Name: get_number_of_diners_at_table
Parameters:
Returns: the number of diners at this table (as an int)
Description: Prompts user to enter the number of diners at this table; collects and returns the user's input (as an int).
-
- Name: get_table_order
Parameters:
Returns: total for the table
Description: calls get_diner_order for each diner at this table; calls calculate_table_total by passing the total of all diners (total of table) before tax; calls display_diners_totals; calls display_table_total_info; Computes and returns the after tax total for the whole table.
-
- Name: get_diner_order
Parameters:
Returns: before tax total for diner
Description: Calls display_menu_of_food_items, and then calls get_menu_item as many times as needed to collect the items ordered by this diner while accumulating the total of the item prices; Returns the before tax total for the diners.
-
- Name: display_menu_of_food_items
Parameters:
Returns:
Description: displays the menu of available food items
-
- Name: get_menu_item
Parameters:
Returns: menu item number
Description: Prompts the user to enter a food item number from the menu; collects and returns the item number the diner is ordering.
-
- Name: display_diners_totals
Parameters: