I am gonna start off saying that I am new to C++, and I have little programming knowledge (just Q Basic, and it has been a while since I have used that), and I need help on an assignment in my C++ class.
We have to use a case function to collect information for an order and display the total, but I have no clue how to get the case to work at all. I am sure the solution is simple, but as I have said I really do not know much about what I am doing.
And... here is the code:
double S=2.50;
double C=1.00;
double B=2.00;
double R=1.00;
double L=1.50;
double &T;
int menu();
int choices();
int main()
{
menu();
choices();
system ("pause");
return 0;
}
int choices()
{
for (n=1, n++)
{
do
{
case 'S'
case 's':
T=T+S;
break;
case 'C'
case 'c':
T=T+C;
case 'B'
case 'b':
T=T+B;
break;
case 'R'
case 'r':
T=T+R;
break;
case 'L'
case 'l':
T=T+L;
break;
case 'X'
case 'x'
T=0;
cout << "The Order Has Been Canceled. \n"
break;
}
}
}
I already have the int menu() function working fine, it is the case stuff I am struggling with.