Tips and Number Variables
Can you create a tip calculator? You'll need to use variables to store numbers.
- Create 2 variables:
- Use the prompt block to prompt the user for their values. Make sure to set the value as a number.
- Create a new variable
tipand 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