Question: Integer variables numSoups and cash are read from input. A soup costs 4 dollars. If numSoups is greater than or equal to 5, then multiply

Integer variables numSoups and cash are read from input. A soup costsInteger variables numSoups and cash are read from input. A soup costs 4 dollars. If numSoups is greater than or equal to 5, then multiply numSoups by 4. If the product of numSoups and 4 is less than or equal to cash, output "Successful purchase!". Otherwise, output "Not enough money to buy all.". If cash is greater than or equal to 4, output "At least one item was purchased." If numSoups is greater than 25, output "Restocking soon.". Otherwise, output "Item still in stock.". End with a newline. Ex: If the input is 13 63, then the output is: Successful purchase! At least one item was purchased. Item still in stock.

Integer variables numSoups and cash are read from input. A soup costs 4 dollars. - If numSoups is greater than or equal to 5 , then multiply numSoups by 4. - If the product of numSoups and 4 is less than or equal to cash, output "Successful purchase!". - Otherwise, output "Not enough money to buy all.". - If cash is greater than or equal to 4, output "At least one item was purchased." - If numSoups is greater than 25, output "Restocking soon.". Otherwise, output "Item still in stock.". End with a newline. Ex: If the input is 13 63, then the output is: Successful purchase! At least one item was purchased. Item still in stock

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!