Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Programming Language 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

Python Programming Language

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 each individual diner (sales tax is 8%). Also, display the total with tax for the whole table, and 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

  1. 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.

  1. List of Program Inputs:

    • Table number

    • Number of diners at table

    • Menu item ordered by a diner

  1. List of Program Outputs:

    • Menu of food items

    • Before tax total for a diner

    • After tax total for a diner

    • 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 and display before and after tax totals for each diner at this 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

Display the grand total (after tax) for the day

Structure Summary

  1. 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.

Call Graph - the graph below shows a visual representation of which functions call which other functions based on the structure summary above

image text in transcribed

main_program get table_number get_ number_of_diners_at_table get table order get_diner_order display_menu_of_ food_items get_menu_item calculate_table_total display_diners_totals >display table_total_info

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Express the following in interval notation. x 25

Answered: 1 week ago

Question

2. Are my sources up to date?

Answered: 1 week ago