hello, this problem has been stressing me out
problem: Jason opened a coffee shop at the beach and sells coffee in three sizes; small(9oz) meduium (12oz) and large (15oz).the cost of one small is $1.75, one medium is 1.90$, and one large is 5.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 number of cps of each size sold.
C)At anytime show the total number of coffee sold.
D)At any time show the total money made.
Your program should consist of tat least the following functions: a function to show the user how to use the program, a function to sell coffee, a function to show the number of cups of each sold, a function to show the total amount of coffee sold, and a function to show the total money made. Your program should not use any global variables and special values such as coffee cup sizes and cost of a coffee cup must be declared as named constants.
Heres what I have (how do implement the total money made) also did I do the rest correctly?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include<iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
char Size;
double Total = 0.0;
int Cupcount = 0;
const double Small = 1.75;
const double Medium = 1.90;
const double Large = 2.00;
cout << "Coffee\n\n";
cout << "Small Cup = " << Small;
cout << "Medium Cup = " << Medium;
cout << "Large Cup = " << Large;
cout << "\n\nWould you like a Large (L), Medium (M), or Small (S) coffee? ";
cin >> Size;
if(Size >90) Size -= 32;
while((Size == 'L')||(Size == 'M')||(Size == 'S'))
{
++Cupcount;
if(Size == 'L')
Total + Large;
if(Size == 'M')
Total + Medium;
if(Size == 'S')
Total + Small;
cout << "\nSo far " << Cupcount << " cups of coffee have been sold :";
cout << " Your Total is: $ " << Total << endl;
system("pause");
return 0;
}
|