Output display help

Hi this is my code. Question?
how would I display the information from option 3 to come out in option 5?
what am I missing ?


#include <iostream>
using namespace std;

int main()
{
int choice;
int menuOn = true;
while (menuOn != false)
{
cout << "*******************************\n";
cout << " 1 - Input Customer Information.\n";
cout << " 2 - Main Selection for our handbags\n";
cout << " 3 - Options\n";
cout << " 4 - Credit card information\n";
cout << " 5 - Display Order Confirmation\n";
cout << " 6 - Exit.\n";
cout << " Enter your choice and press return: ";

cin >> choice; cin.ignore();

switch (choice)
{
case 1:
char name [30];
char number [30];
char address [60];
char zip_code[30];
cout << "*******************************\n";
cout << "Please Enter Your Name: \n";
cin.getline(name, 30);

cout << "Please Enter Your phone number: \n";
cin.getline(number, 30);

cout << "Enter your Address: \n";
cin.getline(address, 60);

cout << "Enter your zip_code: \n";
cin.getline(zip_code, 30);
cout << "\nYour name is: '" << name << "\n' And your number is: '" << number << "\n' And your address is: '" << address << "\n'And your zip_code is:'"
<< zip_code << "'";

break;
case 2:
cout << " Main selection\n";

char bag [30];
char accessory [30];


int accessoryName;
double consoleName, bagCost, accessoryCost, taxRate, totalCost, finalCost;
//get user input
cout << "Hi customer, please choose between the four types of handbags:\n";
cout << "A:Fendi for $4,250.99\n";
cout << "B:Valentino for $4,145\n";
cout << "C:Michael Kors for $2300.95\n";
cout << "D:Saint Laurent for $2,290.00\n";
cout << "Please Enter Selected: \n";
cin.getline(bag, 30);
cout<<"What is the cost of the bag?"<<endl;
cin>>bagCost;
cout << "\nThank you for choosing the handbag , please choose between the three types of accessories:\n";
cout << "E:Bag tassel $130.45\n";
cout << "F:Bag patches $126.29\n";
cout << "G:Feather Bag Charm $95.55.\n";
cin.ignore();
cout << "Please Enter Your selected accessory: \n";
cin.getline(accessory, 30);
cout<<"what is the cost of the accessory? (do not include $)"<<endl;
cin>>accessoryCost;
cout<<"Enter 1 for tax rate. (do not include $)"<<endl;
cin>>taxRate;
//calculate total cost
totalCost=bagCost+accessoryCost*(1+taxRate/100);
finalCost=((int)(totalCost*100+9.75))/100.0;
cout<<"Your total for the bag and accessory "<<accessoryName<<" is $"<<finalCost<<endl;
break;
case 3:
cout << "options\n";
{
char value;
cout << "Congratulations. You will get the following free gift with your order: ";
cout << "If you select 2 or more accessories Enter A: ";


cin >> value;
switch (value)
{
case 'a':
cout << "Selecting 2 accessories: . "
<< "Congrats, you get a phone case, and pair of sandals.\n";
break;
case 'b':
cout << "Very good. ";
value = 'a';
cout << "You get a 35 dollar gift certificate. Thank you for shopping with us. "
<<value << endl;
break;
case 'c':
cout << "Thank you for shopping with us.\n";
cout << "You get a free phone case, have a good day!\n";
break;
case 'd':
cout << "Thank you for shopping with us.. "
<< "You get a pair of free sandals, go to the front to claim your gift.\n";
break;
default:
cout << "That is not a choice try again.\n";

}
cout << "Go to the front desk to get your gift.\n";
break;
}
break;
case 4:
char visa[20];
char mastercard[20];
char cash[40];
cout << "*******************************\n";
cout << "Please Enter Your visa information if no visa hit na: \n";
cout << "Enter your 16 digit card number: \n";
cin.getline(visa, 20);

cout << "Please Enter Your Master_card if no Master_card hit na: \n";
cout << "Enter your 16 digit card number: \n";
cin.getline(mastercard, 20);

cout << "Enter tender cash please: \n";
cout << "If paying with card hit or enter na: \n";
cin.getline(cash, 40);

cout << "Your visa is: '" << visa << "\n And your Master_card is: '" << mastercard << "\n And cash entered: '" << cash << "'";
break;
case 5:
cout << "*******************************\n";
cout << " Display Order Confirmation\n";

char name1[30];
char number2[30];
char address3[30];
char zip_code4[30];
char visa5[20];
char mastercard6[20];
char cash7[40];
char bag8 [30];
char accessory9 [30];


cout << "You have placed an order for";
cout<<"With the following accessories "<<accessoryName<<" is $"<<finalCost<<endl;
cout << "You have placed an order for: '" << name << "\n' Your number is: '" << number << "\n' Your address is: '" << address << "\n'And your zip_code is:'"
<< zip_code << "'";
cout << "paid by";
cout << "Your visa is: '" << visa << " \nAnd your Master_card is: " << mastercard << "\n And cash entered: " << cash << "'";



break;
case 6:
cout << "*******************************\n";
cout << "End of Program.\n";
menuOn = false;
break;
default:
cout << "Not a Valid Choice. \n";
cout << "Choose again.\n";
cin >> choice;
break;
}

} while (choice !=6);
return 0;
}
Thank you everyone.
Last edited on
I cannot display the accessory's name at order form just the total. i wanted to display it separately then the whole total.

What do you mean? Can you give us a sample output?
When I enter 3::


Enter your choice and press return: 3
options
Congratulations. You will get the following free gift with your order: If you select 2 or more accessories Enter A:



I want all this info to show up at option 5

Enter your choice and press return: 5
*******************************
Display Order Confirmation
You have placed an order forWith the following accessories 582953209 is $1.98019e-307
You have placed an order for: '$TÇ@
' Your number is: 'àtφv╕?≥v∞■j
' Your address is: '
'And your zip_code is:'Mîö■j'paid byYour visa is: '╣^$T
And your Master_card is: X■j
And cash entered: '*******************************


inserted here::

please help :: Thank you in advance
:)




Topic archived. No new replies allowed.