C++ question:
Jason opened a coffee shop selling coffee, cheese cakes, and coffee beans. Coffee is sold at the shop in two sizes: small (9 oz, $1.5) and large (12 oz, $1.9). Cheese cakes cost $3 per slice. Coffee beans are sold with $0.6 per oz. Write a menu-driven program that will make the coffee shop operational.
Your program should allow the user to do the following:
Choose among coffee, cakes, or beans to purchase.
Buy coffee in any size and in any number of cups.
Buy cheese cakes in any number of slices.
Buy coffee beans in any amount.
At any time show the total number of cups of each size sold, total number of slices of cakes sold, and total amount of coffee beans sold.
At any time show the total amount of coffee sold.
At any time show the total money made.
Your program should consist of at least the following functions:
a function to show the user how to use the program,
a function to sell coffee,
a function to sell cakes,
a function to sell coffee beans,
a function to show the number of cups of each size of coffee, the number of slices of cheese cakes, and the amount of coffee beans sold,
a function to show the total amount of coffee sold,
a function to show the total money made.
Your program should not use any global variables. Special values such as coffee cup sizes and cost of a coffee cup must be declared as named constants.
#include<iostream>
#include<cstdlib>
using namespace std;
//giving items types in structure it is not declaration items declared in use_program() function below
struct item{
float money;
int n9coffee;
int n12coffee;
int ncake;
int nbeans;
};
//function for sell coffee
item sell_coffee(item t){
int a,n;
cout<<"Enter 1 for 9oz\t2 for 12 oz"<<endl; //choose type of coffee 9oz or 12oz
cin>>a;
while(a!=1&&a!=2){
cout<<"Invalid choice try again"<<endl;
cin>>a;
}
cout<<"Enter how many Coffee you want to buy"<<endl;
cin>>n;
//calculating money for 9oz coffee
if(a==1){
t.n9coffee+=n;
t.money+=(float)n*1.5;
}
//calculating money for 12oz coffee
else{
t.n12coffee+=n;
t.money+=(float)n*1.9;
}
return t; //return the structure
}
//function for sell cake
item sell_cake(item t) {
int n;
cout<<"Enter how many Cake Slices you want to buy"<<endl;
cin>>n;
t.ncake+=n;
t.money+=(float)n*3; //calculating money for cake
return t; //return the structure
}
//function for sell coffee beans
item sell_coffee_beans(item t) {
int n;
cout<<"Enter how much oz's you want to buy"<<endl;
cin>>n;
t.nbeans+=n;
t.money+=(float)n*0.6; //calculating money for coffee beans
return t; //return the structure
}
//function for printing number of items sold
void sold(item t){
cout<<"Number of sold Items"<<endl;
cout<<"Coffee 9oz\t"<<t.n9coffee<<endl; //printing coffee 9oz
cout<<"Coffee 12oz\t"<<t.n12coffee<<endl; //printing coffee 12oz
cout<<"Chese Cake\t"<<t.ncake<<endl; //printing cake
cout<<"Coffee Beans\t"<<t.nbeans<<endl; //printing coffee beans
}
//function for money earned
void total_money(item t) {
cout<<"Total Money earned is : "<<t.money<<endl;
}
int main(){
int ch;
item t; //declaring structure item means that declaring all variables
t.money=0; //initilizing all items to 0 initially
t.n9coffee=0;
t.n12coffee=0;
t.ncake=0;
t.nbeans=0;
while(1){
cout<<endl;
cout<<"COFFEE shop MENU\n1.Buy Coffee\n2.Buy Cake\n3.Buy Coffee Beans\n4.Show total sold\n5.Show total Money earned\n6.Quit"<<endl;
cout<<"Enter Your Choice"<<endl;
cin>>ch;
switch(ch){
case 1:t=sell_coffee(t); //call for sell coffee
break;
case 2:t=sell_cake(t); //call for sell cake
break;
case 3:t=sell_coffee_beans(t); //call for sell coffee beans
break;
case 4:sold(t); //call for items sold
break;
case 5:total_money(t); //call for money earned
break;
case 6:exit(0);
default: cout<<"Invalid Choice try again"<<endl;
}
}
return 0;
}
Output:

C++ question: Jason opened a coffee shop selling coffee, cheese cakes, and coffee beans. Coffee is...
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: a. Buy coffee in any size and in any number of cups. b. At any time show the total...
Problem analysis and algorthim design please 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: a. Buy coffee in any size and in any number of cups. b....
Write for python: 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, on e medium cup is $1.90, and one large cup is $2.00. Program should allow to do the following: 1.Buy coffee in any size and in any number of cups 2.At any time show the total number of cups of each size sold. 3.At any time show the...
At a certain coffee shop, all the customers buy a cup of coffee and some also buy a doughnut. The shop owner believes that the number of cups he sells each day is normally distributed with a mean of 320 cups and a standard deviation of 24 cups. He also believes that the number of doughnuts he sells each day is independent of the coffee sales and is normally distributed with a mean of 150 doughnuts and a standard deviation...
At a certain coffee shop, all the customers buy a cup of coffee and some also buy a doughnut. The shop owner believes that the number of cups he sells each day is normally distributed with a mean of 340 cups and a standard deviation of 21 cups. He also believes that the number of doughnuts he sells each day is independent of the coffee sales and is normally distributed with a mean of 150 doughnuts and a standard deviation...
3.*Coffee 'N Cakes offers coffee in a variety of sizes. The following is the number of times each size of coffee was sold over the past 150 orders: Number of Orders Oun of Coffeeo 32 18 36 42 21 150 12 Find the expected value, variance, and standard deviation of the number of ounces of coffee sold per order a. Ao. mlusrae the probabiliryfuncion uing hisogsm See problem (3). Coffee 'N Cakes sells its coffee for $.35 per ounce. They...
Survival Analys.. At a certain coffee shop, all the customers buy a cup of coffee and some also buy a doughnut The shop owner believes that the number of cups he sells each day is normal distributed with a mean of 330 cups and a standard deviation of 23 cups. He also believes that the number of doughnuts he sells each day is independent of the coffee sales and is normally distributed with a mean of 180 doughnuts and a...
At a certain coffee shop, all the customers buy a cup of coffee and some also buy a doughnut. The shop owner believes that the number of cups he sells each day is normally distributed with a mean of 310cups and a standard deviation of 21cups. He also believes that the number of doughnuts he sells each day is independent of the coffee sales and is normally distributed with a mean of 180 doughnuts and a standard deviation of 11....
Using C#, write a program. You are a coffee and tea shop. You will allow customers to enter their orders. You sell coffee and tea in three sizes, small coffee for $1.00, medium for $1.20, and large for $1.40. Tea is $1.20, $1.40, and $1.60. You will let ask the user what they want, size, ask if they want to order anything else, continue taking their order. At the end show them how much they owe. If they order more...
3. The first coffee shop in LH (a small town of ten thousand residents in the Midwest) is opening in a month. The store is selling freshly brewed coffee in three sizes: small (5 fl. oz.), medium (8 fl. oz.) and large (11 fl. oz.), and the cost of the coffee is 10 cents per fl. oz. The marketing research that the storeowner, Luc, conducted show that there are four thousand people who drink coffee in this town, and they...