Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started