Sam and his friends are planning a fun summer holiday. They have saved up $250 each to spend on various activities. They want to visit a theme park, go to the movies, buy some snacks, rent bikes for a day, and go to the beach. Sam wants to know how much money he has left after all these activities.
Scenario:
Sam’s tasks involve several steps:
Initial Savings:
- Start by defining a variable for the initial savings and set it to $250.
Track Expenses:
- Ask Sam how much he spent on the theme park ticket and store it in a variable called
theme_park_cost
(as an integer). - Ask how much he spent on the movies and store it in a variable called
movies_cost
(as an integer). - Ask how much he spent on snacks and store it in a variable called
snacks_cost
(as an integer). - Ask how much he spent on renting bikes and store it in a variable called
bikes_cost
(as an integer). - Ask how much he spent on the beach trip and store it in a variable called
beach_cost
(as an integer).
- Ask Sam how much he spent on the theme park ticket and store it in a variable called
Calculate Total Expenses:
- Calculate the total expenses by adding
theme_park_cost
,movies_cost
,snacks_cost
,bikes_cost
, andbeach_cost
.
- Calculate the total expenses by adding
Calculate Remaining Money:
- Calculate the amount left by subtracting the total expenses from the initial savings.
Check Savings Status:
- Use an if condition to check if there is still money saved or if Sam spent more than he saved.
Print a Message:
- Print a message that tells Sam how much he has left and whether he still has savings or spent more than he saved.
Let’s create a Python program to help Sam with his tasks.