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

Jason opened a coffee shop at the beach and sells coffee in three sizes: small (

ID: 3573299 • Letter: J

Question

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. The buy coffee option allows the customer to select the number of cups in each of the sizes they want to order and display a receipt for that order The other three options would be used by the owner to check on the status of the shop during the day. Pay attention to the user interface. Try to minimize the number of mouse clicks and display output neatly Turn in your source code which should be commented as follows: Analysis at the top of the file Function analysis, preconditions, and post conditions after each function prototype Major tasks identified as comments in main function Comments in functions as needed

Explanation / Answer

#include <iostream>
using namespace std;
int TotalSquant=0;
int TotalMquant=0;
int TotalLquant=0;
int Totalcups=0;
   float smallcup=1.75;
   float mediumcup=1.90;
   float largecup=2.00;
   float TotalAmountmade=0.0;
void orderGiven(){
int choice;
int squant=0;
int mquant=0;int lquant=0; int size,i;
cout<<"How many cups of cofee you want and it's size? "<<"Please select from the below menu ";
cout<<"1.smallcup ";
cout<<"2.mediumcup ";
cout<<"3.largecup ";
cout<<"Please enter variety i.e if you want all the 3 size enter 3 else if you want only 2 size enter 2 else 1 ";
cin>>size;
for(i=0;i<size;i++){
cout<<"Enter your choice of cup as numbers,i.e 1 , 2 , 3 Thanks ";
cin>>choice;
switch(choice){
case 1:
cout<<"Please tell the quantity small cup ";
cin>>squant;
break;
case 2:
cout<<"Please tell the quantity for medium cup ";
cin>>mquant;
break;
case 3:
cout<<"Please tell the quantity for large cup ";
cin>>squant;
break;
default:
cout<<"wrong selection ";
break;
}
}
cout<<"Order Given is ";
cout<<"Quantity of Small Size cofee is "<<squant;
cout<<"Quantity of medium Size cofee is "<<mquant;
cout<<"Quantity of Large Size cofee is "<<lquant;
TotalSquant=TotalSquant+squant;
TotalMquant=TotalMquant+mquant;
TotalLquant=TotalLquant+lquant;
}
void display(){
cout<<"Total Small Qunatity of Cofee sold "<<TotalSquant;
cout<<"Total Medium Qunatity of Cofee sold "<<TotalMquant;
cout<<"Total Large Qunatity of Cofee sold "<<TotalLquant;
}

void sold(){
Totalcups=TotalLquant+TotalSquant+TotalMquant;
cout<<"Total cups of cofee sold are "<<Totalcups;
}
void amountmade(){
TotalAmountmade=(TotalSquant*smallcup)+(TotalMquant*mediumcup)+(TotalLquant*largecup);
cout<<"The Total money made is "<<TotalAmountmade;
}
  
int main() {
   int menuchoice;
   cout<< "<--MENU--> ";
   cout<< "1.Order recieved(Cofee in any size and in any number of cups ";
   cout<< "2.Total number of cups sold ";
   cout<< "3.Total amount of cofee sold ";
   cout<< "4.total money made ";
   cout<< "5.Exit ";
   cout<< "Enter your operation choice as: ";
   cin>>menuchoice;
   switch(menuchoice){
   case 1:
   void orderGiven();
   break;
   case 2:
   void display();
   break;
   case 3:
   void sold();
   break;
   case 4:
   void amountmade();
   break;
   case 5:
   cout<<"Thanks see you again ";
   break;
   }
   return 0;
}

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