Focus:

Use the if/Elif/Else structure to write a Tipper program that helps split a restaurant bill between friends and suggests the percentage tip.

Part A: Decision Structure - Tipper Program

Display a welcome message to the user explaining what this program does for the user. Then,

  • Prompt the user to enter his/her name
  • Prompt the user to enter the final bill amount.
  • Prompt the user to enter the number of people splitting that bill.
  • Ask user how much they want to tip (15%, 18%, or 20%)
  • Perform the math operations and display the following information to the user:
Hello < username>, the calculations for splitting the bill is as follows:
Final Bill Amount = $
Final Bill Amount + 15% tip = $
Final Bill Amount + 18% tip = $
Final Bill Amount + 20% tip = $
Number of people splitting the bill =
Each person's share of the actual final bill without including the tip = $
Each person's share with 15% tip included = $
Each person's share with 18% tip included = $
Each person's share with 20% tip included = $

Hint #1: Remember to use the input() function to prompt the user for information.

Hint#2: Remember that input() returns a string. To convert the return value to a float, use the float() function

Follow good programming practices by separating each logical block by at least a line in between and explaining with a comment at the top of each block. For example:

# Displaying welcome message
----code to display welcome message

# Taking user inputs for all variables
--- code for user input

# Internal calculation
--- code for internal calculations

# Display final values on screen
--- code for displaying results

Note: The above formatting is just an example. You are welcome to organize the code in whatever way you find the most logical.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.