John has $250 saved up. He plans to spend some of this money on various activities and then split the remaining amount equally for his next few outings. Write a Python program to calculate how much money John has left after his expenses and how much money he can allocate for each outing. Use an if condition to tell him if he can still go for outings or if he spent all his money.
- Start by defining a variable for the initial savings and set it to $250.
- Ask John how much he spent on a new pair of shoes and store it in a variable called
shoes_cost
(as an integer). - Ask how much he spent on groceries and store it in a variable called
groceries_cost
(as an integer). - Ask how much he spent on a movie ticket and store it in a variable called
movie_ticket_cost
(as an integer). - Ask how much he spent on a gift and store it in a variable called
gift_cost
(as an integer). - Ask how much he spent on a meal and store it in a variable called
meal_cost
(as an integer). - Calculate the total expenses by adding
shoes_cost
,groceries_cost
,movie_ticket_cost
,gift_cost
, andmeal_cost
. - Calculate the amount left by subtracting the total expenses from the initial savings.
- Ask John how many outings he wants to plan and store it in a variable called
num_outings
(as an integer). - Calculate the amount per outing by dividing the amount left by
num_outings
if the amount left is greater than zero. - Use an if condition to check if there is still money left to go for outings or if he spent all his money.
- Print a message that tells him how much he has left and whether he can go for outings or if he spent all his money.