Question: ( Phyton problem ) num _ soups and total _ allowance are read from input. A soup costs 7 dollars. If num _ soups is

(Phyton problem) num_soups and total_allowance are read from input. A soup costs 7 dollars.
If num_soups is less than 3, then output 'Not enough soups.'
If num_soups is greater than or equal to 3, then assign total_cost with the product of num_soups and 7.
If total_cost is less than or equal to total_allowance, then output 'Successful purchase!'
Otherwise, output 'Need more money to purchase all.'
If total_allowance is greater than or equal to 7, then output 'At least one item was purchased.'
Click here for examples
Ex 1: If the input is:
1
75
then the output is:
Not enough soups.
Ex 2: If the input is:
27
259
then the output is:
Successful purchase!
At least one item was purchased.
Ex 3: If the input is:
11
39
then the output is:
Need more money to purchase all.
At least one item was purchased.

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!