OEIECTIVES Review the dowhile looo Review the witch statemen

OEIECTIVES: -Review the do-while looo -Review the witch statement -Review how to format the output in columns -How to createand call the user-defined function: -Apply reference paramenter to user-defined functon

Solution

#include <stdio.h>

int main()
{
int number;
char size;
int nos_cups;
int nom_cups;
int nol_cups;
int s_price=1.19;
int m_price=1.49;
int l_price=1.89;
int s_total;
int m_total;
int l_total;
int subtotal;
int tax;
int total;
printf(\"****COFFEE SHOP******\ \");
printf(\"1.Sale coffee\ \");
printf(\"2.Total number of cups sold\ \");
printf(\"3.Total amount of Coffee sold\ \");
printf(\"4.Total amount of money made\ \");
printf(\"0.Exit!\ \");
printf(\"enter the number\");
scanf(\"%d\",&number);
while(number>0){
switch(number){
case 1:
  
  
printf(\"select number of small cups \ \");
scanf(\"%d\",&nos_cups);
s_total=nos_cups*s_price;

printf(\"select number of medium cups \ \");
scanf(\"%d\",&nom_cups);
m_total=nom_cups*m_price;
printf(\"select number of large cups \ \");
scanf(\"%d\",&nol_cups);
l_total=nol_cups*l_price;
subtotal=s_total+m_total+l_total;
tax=(subtotal*0.0825);
total=subtotal-tax;
printf(\"SIZE\\tnumber\\tprice\\ttotal\ \");
printf(\"\ Small\\t\",nos_cups,\"\\t\",s_price,\"\\t\",s_total);
printf(\"\ Small\\t\",nom_cups,\"\\t\",m_price,\"\\t\",m_total);
printf(\"\ Small\\t\",nol_cups,\"\\t\",l_price,\"\\t\",l_total);
printf(\"\ subtotal\\t\",subtotal);
printf(\"\ tax\\t\",tax);
printf(\"\ total\\t\",total);
  
  
  
}
printf(\"****COFFEE SHOP******\ \");
printf(\"1.Sale coffee\ \");
printf(\"2.Total number of cups sold\ \");
printf(\"3.Total amount of Coffee sold\ \");
printf(\"4.Total amount of money made\ \");
printf(\"0.Exit!\ \");
}
  

return 0;
}

 OEIECTIVES: -Review the do-while looo -Review the witch statement -Review how to format the output in columns -How to createand call the user-defined function:
 OEIECTIVES: -Review the do-while looo -Review the witch statement -Review how to format the output in columns -How to createand call the user-defined function:

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site