Question: num _ turkeys and num _ dollars are read from input. A turkey costs 9 dollars. If num _ turkeys is greater than or equal

num_turkeys and num_dollars are read from input. A turkey costs 9 dollars.
If num_turkeys is greater than or equal to 3, then assign total_cost with the product of num_turkeys and 9.
If total_cost is less than or equal to num_dollars, then output 'Successful purchase!'
Otherwise, output 'Not all turkeys purchased.'
If num_turkeys is greater than 21, then output 'Now out of stock.'
Click here for examples
Ex 1: If the input is:
34
396
then the output is:
Successful purchase!
Now out of stock.
Ex 2: If the input is:
115
528
then the output is:
Not all turkeys purchased.
Now out of stock.
Ex 3: If the input is: 13
83
then the output is:
Not all turkeys purchased.
 num_turkeys and num_dollars are read from input. A turkey costs 9

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!