Question: Write a c + + program to compute the cost of sweet treats. Ask the user to input a character to determine whether the treat
Write a c program to compute the cost of sweet treats.
Ask the user to input a character to determine whether the treat is a muffin or a donut. The user will input for a muffin and D for a donut. If the user inputs any other character, print an error message.
If the character is or : Ask the user to input an integer indicating the number of donuts or muffins. compute the total cost of muffins or donuts.
Additionally, if the number of donuts or muffins is or More; determine the number of boxes needed to hold the treats. Each box can hold one dozen dozen treats.
For example, if the input is and number of muffins is then total cost: Dhs Number of boxes needed for muffins is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
