Question: what is the code needed in c++ Jump to level 1 Integers numHams and allowance are read from input. A ham costs 10 dollars: -

Jump to level 1 Integers numHams and allowance are read from input. A ham costs 10 dollars: - If numHams is greater than or equal to 3, then declare and initialize int variable totalcost with the product of numHams and 10 - If totalCost is less than or equal to allowance, output "Successful purchasel" - Otherwise, output "Not enough money to buy all." - If allowance is greater than or equal to 10, output 'At least one item was purchased." - If numHams is greater than 22, output 'Restocking soon." End with a newline. Ex: If the input is 17190 , then the output is: Successful purchase! At least one item was purchased. 1 -include $ allowance
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
