Tips and Number Variables
Collapse Content
Show Content
Can you create a tip calculator? You'll need to use variables to store numbers.
Tip Calculator
- Create 2 variables:
bill
andpercent
. - Use the prompt block to prompt the user for their values. Make sure to set the value as a number.
- Create a new variable
tip
and use some math blocks to assign it the correct tip. - Print out the final answer.
Since you asked for the percent, you'll need to multiply by 0.01 to get the final answer. You can nest one math block inside another one.
See also Tip Challenge