← Back to User Input
Question 167
Add The Tip
Add The Tip
Ask for a restaurant bill with the prompt Bill? (a decimal number) and a tip percentage with Tip percent? (a whole number), then print the bill plus the tip with two decimals in the form Total with tip: <value>. The tip is the bill times the percent divided by 100. Input: two lines, the bill then the percent. Both prompts are part of the output and input() stays on the same line, so the prompts and the total share one output line.
Expected Output:
Bill? Tip percent? Total with tip: 57.50= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
User Input
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.