Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Integer variables numSteaks and dollarAmount are read from input. A steak costs 20 dollars. - If numSteaks is less than 5 , output numSteaks requires

image text in transcribed

Integer variables numSteaks and dollarAmount are read from input. A steak costs 20 dollars. - If numSteaks is less than 5 , output "numSteaks requires at least 5 to purchase.". - If numSteaks is greater than or equal to 5 , then multiply numSteaks by 20. - If the product of numSteaks and 20 is less than or equal to dollarAmount, output "Successful purchase!". - Otherwise, output "Need more money to purchase all.". - If numSteaks is greater than 22, output "Restocking soon.". Otherwise, output "Item still in stock.". End with a newline. Ex: If the input is 12266 , then the output is: Successful purchase! Item still in stock. 12345678910111213#includeusingnamespacestd;intmain(){intnumSteaks;intdollarAmount;cin>>numSteaks;cin>>dollarAmount;Yourcodegoeshere*/return0

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

Question

5. If yes, then why?

Answered: 1 week ago

Question

6. How would you design your ideal position?

Answered: 1 week ago