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 M for a muffin and D for a donut. If the user inputs any other character, print an error message.
If the character is M or D : 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 12 or More; determine the number of boxes needed to hold the treats. Each box can hold one dozen (1 dozen =12) treats.
For example, if the input is M and number of muffins is 15, then total cost: 15**5=75 Dhs. Number of boxes needed for 15 muffins is 2.
 Write a c++ program to compute the cost of sweet treats.

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!