Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions