Deliverables

Create a Tip Calculator

If you live in the United States, then you are aware that tipping is everywhere. This was turbocharged with the pandemic. There are even stories of people being prompted for tips from automated systems.

Needless to say, it makes sense to have a tip calculator! In this contrived example, write some code to calculate the tip. This tip calculator should show:

  • The total amount of the bill
  • 10% tip
  • 15% tip
  • 20% tip

Here are some example values:

  • Sam’s bill: 28.32
  • Edith’s bill: 18.75
  • Katie’s bill: 21.61
  • Kayla’s bill: 24.92

The total value is 93.60 10% tip brings the total to 102.96 15% tip brings the total to 107.64 20% tip brings the total to 112.32

Note: Do not worry about trailing decimal points. For instance, you may see your total printed as: 93.60000000000001. This is fine.

Finally, use some emojis to add a little “style” to your tip calculator. Here’s an example:

See forum comments
Download course materials from Github
Previous: Overview Next: Answer Key