Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coffee Shop Program Specification We will write a program to take an order from a customer, compute the total charge, compute their change, and show

image text in transcribed

Coffee Shop Program Specification We will write a program to take an order from a customer, compute the total charge, compute their change, and show the receipt Our Coffeeshop sells these items: Coffee: $2.50 Bagel: $1.75 Donut: $1.00 Steps: 1. Display a welcome message, like "Welcome to our Coffeeshop!" 2. Prompt the user for their first name 3. Prompt the user for the number of: coffees, bagels and donuts Often, programmers write up an example use case' before starting a program. It clarifies the project specification (on the left). Sample Use Case (User Input Bolded): 4. Calculate the total amount, after adding in 8.5% tax 5. Give the user the total. 6. Prompt the user for how much they will pay 7. Calculate the change 8. Finally, generate a receipt Note 1: this is one way to calculate the total with tax for this example (2*2.50 + 1*1.75 +3*1.00) * 1.085 Welcome to our Coffeeshop! What is your first name? Mark Welcome Mark! How many coffees? 2 How many bagels? 1 How many donuts? 3 Your total is: $10.58 How much will you pay? 15.00 Receipt for Customer: Mark Coffees: 2 Bagels: 1 Donuts: 3 Total is: $10.58 Your change is: $4.42 Note 2: You will need the following 3 lines at the top of main if you want your float or double numbers to show up with 2 decimal places: sout, setf(ies:: fixed); coutsetflies::showpoint); cout.precision(2)

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_2

Step: 3

blur-text-image_3

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago