Answered step by step
Verified Expert Solution
Link Copied!

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 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions