Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ program Jason opened a coffee shop at the beach and sells coffee in three si

ID: 675243 • Letter: C

Question

C++ program Jason opened a coffee shop at the beach and sells coffee in three sizes: small (9oz), medium (12oz), and large (15oz). The cost of one small cup is $1.75, one medium cup is $1.90, and one large cup is $2.00. Write a menu-driven program that will make the coffee shop operational. Your program should allow the user to do the following:

Buy coffee in any size and in any number of cups.

At any time show the total number of cups of each size sold.

At any time show the total amount of coffee sold.

At any time show the total money made.

Complete the analysis and design started below, implement the design, compile and test your code, and turn in your completed analysis and design, and your source code.

Explanation / Answer

#include <iostream>
#include <fstream>

using namespace std;

int main() {
int small=0,med=0,large=0,total=0;
int flag=0,n,opt;
double cost,tmoney=0;
while(flag==0){
cout<<"Menu for Day!!!!"<<endl;
cout<<"Coffee size enter 1.for small 2.for medium 3.for large"<<endl;
cout<<"your option: ";
cin>>opt;
switch(opt){
case 1:
cout<<"Enter number of cups: ";
cin>>n;
total=total+n*9;
small=small+n;
cost=(double)n*1.75;
cout<<"Your bill is: "<<cost<<endl;
tmoney=tmoney+cost;
break;
case 2:
cout<<"Enter number of cups: ";
cin>>n;
total=total+n*12;
med=med+n;
cost=(double)n*1.90;
cout<<"Your bill is: "<<cost<<endl;
tmoney=tmoney+cost;
break;
case 3:
cout<<"Enter number of cups: ";
cin>>n;
total=total+n*15;
large=large+n;
cost=(double)n*2.00;
cout<<"Your bill is: "<<cost<<endl;
tmoney=tmoney+cost;
break;
case 4:
cout<<"Quitting !!!!!"<<endl;
flag=1;
break;

}
cout<<"Number of cups of small size sold: "<<small<<endl;
cout<<"Number of cups of medium size sold: "<<med<<endl;
cout<<"Number of cups of large size sold: "<<large<<endl;
cout<<"Total amount of coffe sold: "<<total<<"oz"<<endl;
cout<<"Money made till now: $"<<tmoney<<endl;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote