Question: Python: num _ cheesecakes and dollar _ amount are read from input. A cheesecake costs 1 5 dollars. If num _ cheesecakes is less than

Python: num_cheesecakes and dollar_amount are read from input. A cheesecake costs 15 dollars.
If num_cheesecakes is less than 5, then output 'Not enough cheesecakes.'
If num_cheesecakes is greater than or equal to 5, then assign total_cost with the product of num_cheesecakes and 15.
If total_cost is less than or equal to dollar_amount, then output 'Cheesecakes successfully purchased.'
Otherwise, output 'Need more money to purchase all.'
If dollar_amount is greater than or equal to 15, then output 'At least one item was purchased.'
If num_cheesecakes is greater than 24, then output 'Restocking soon.'
Ex 1: If the input is:
4
5
then the output is:
Not enough cheesecakes.
Ex 2: If the input is:
112
1719
then the output is:
Cheesecakes successfully purchased.
At least one item was purchased.
Restocking soon.
Ex 3: If the input is:
92
1249
then the output is:
Need more money to purchase all.
At least one item was purchased.
Restocking soon.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!