JuaInstitute

Practice: Build a Tip Calculator

Time to build something real using everything from this week: variables, types, operators, input, and formatted output.

Your tip calculator should:

  1. Ask for the bill amount
  2. Ask for a tip percentage
  3. Calculate the tip amount and the total (bill + tip)
  4. Print both, each formatted to exactly 2 decimal places, using f-strings

Work through it in the code editor below. This is graded — your tutor can see exactly what you submit.


Build a Tip Calculator

Write a program that:

  1. Asks for the bill amount (input(), converted to float)
  2. Asks for a tip percentage (input(), converted to float)
  3. Calculates the tip amount: bill * (tip_percent / 100)
  4. Calculates the total: bill + tip_amount
  5. Prints the tip and total, each formatted to exactly 2 decimal places using an f-string, in the format Tip: $X.XX and Total: $X.XX
Getting Input and Printing OutputNext: Making Decisions: if, elif, else 🔒