Question: Answer in Java please Integers numSalads and cash are read from input. A salad costs 15 dollars. - If numSalads is greater than or equal
Answer in Java please
Integers numSalads and cash are read from input. A salad costs 15 dollars. - If numSalads is greater than or equal to 3 , then declare and initialize int variable totalCost with the product of numSalads and 15. - If totalCost is less than or equal to cash, output "Salads successfully purchased." - Otherwise, output "Need more money to purchase all." - If numSalads is greater than 29 , output "Restocking soon." Otherwise, output "Item still in stock." End with a newline. Ex: If the input is 6110 , then the output is: Salads successfully purchased. Item still in stock
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
