← Back
Code Challenge 5 - Tip Calculator
Introduction
Let’s be honest, you’re probably a cheapskate. You need a program that allows you to calculate how much you are supposed to tip.
Terms
Bill/Subtotal - How much your food and drink cost
Tip/Gratuity - How much money you would like to give your server. Usually 18% - 20% of the subtotal.
Total - Final cost: bill + tip.
Examples
- A $10 bill with 20% tip
- A $25 bill with 18% tip
Skills to Practice
- Getting numeric user input
- Saving user input to variables
- Performing arithmetic
- Formatting strings
Challenge Tasks
- Create a console project named CodeChallenge5TipCalculator.
- Complete the folowing tasks:
- Prompt the user to enter their bill amount.
- Prompt the user to enter their tip percentage as a whole number. For example, 20 means 20%.
- Calculate how much the user should tip and the total.
Sample Output