Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started