Question: Python 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

Python

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.

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; 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 this diner.

Name: display_menu_of_food_items

Parameters:

Returns:

Description: displays the menu of available food items

Name: get_menu_item

Parameters:

Returns: total for the table

Description: Prompts the user to enter a food item from the menu; collects and returns the item the diner is ordering.

Name: display_diners_totals

Parameters: total_diner_1, total_diner_2, total_diner_3, total_diner_4

Returns:

Description: Displays the before and after tax totals for each diner at this table.

Name: calculate_table_total

Parameters: total_diner_1, total_diner_2, total_diner_3, total_diner_4

Returns: after tax total for table

Description: Calculates and returns the after tax total for the table.

Name: display_table_total_info

Parameters: table_total

Returns:

Description: Displays the after tax total for this table, and displays suggested tip amounts.

Name: main_program

Parameters:

Returns:

Description: Repeatedly calls get_table_number, get_number_of_diners_at_table, and get_table_order until the user reports that there are no more tables for today, while accumulating the total sales for the day; then outputs the total sales for the day.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!