When I run the program and tell for a new customer is couts the the "Please enter Name" but does allow my to input anything. It also does this on the "Please enter phone number". Thanks for any help that i can get. I put the code tags hopes i did it right.
Code:
<code>
#include <iostream.h>
int main()
{
char address[70];
char name[50];
char phone[20];
char description[200];
double total;
int zip;
int correct=2;
int id=0000;
int id2;
int option;
int quanf=1;
int quan46=1;
int qaun57=1;
int quan810=1;
int quanf57=1;
double pricef;
double price46;
double price57;
double price810;
double pricef57;
double product[10];
cout<<"Welcome to my first Register Program\n";
cout<<"*******Good Luck Today*******\n";
for (int i=0;i<100;i++)
{
cout<<"Please chose an option:\n";
cout<<"(1)New Customer\n(2)Previos Customer\n(3)Exit\n";
cin>>option;
switch(option)
{
case 1:
while(correct==2)
{
cout<<"Please enter name:\n";
cin.getline(name, 50, '\n');
cout<<"Please enter address:\n";
cin.getline(address, 70, '\n');
cout<<"Please enter zip code:\n";
cin>>zip;
cout<<"Please enter phone number:\n";
cin.getline(phone, 20, '\n');
cout<<"Please enter description:\n";
cin.getline(description, 200, '\n');
cout<<endl<<"Name: "<<name<<endl;
cout<<"Address: "<<address<<endl;
cout<<"Zip Code: "<<zip<<endl;
cout<<"Phone: "<<phone<<endl;
cout<<"Description: "<<description<<endl;
cout<<"Is this information correct?\n(1)Yes\n(2)No\n";
cin>>correct;
}
product[0]=10.00; //Product one: 4X6
product[1]=10.00; //Product two: Frame
product[2]=15.00; //Product three: 5X7
product[3]=15.00; //Product four: Frame with 5X7
product[4]=20.00; //Product five: 8X10
product[5]=0.00; //Product six: Other
correct=2;
while(correct==2)
{
cout<<"How many 4X6 were purchase:\n";
cin>>quan46;
cout<<"How many 5X7 were purchase:\n";
cin>>qaun57;
cout<<"How many 8X10 were purchase:\n";
cin>>quan810;
cout<<"How many FRAMES were purchase:\n";
cin>>quanf;
cout<<"How many FRAMES W/ 5X7 were purchase:\n";
cin>>quanf57;
cout<<"4X6: "<<quan46<<endl;
cout<<"5X7: "<<qaun57<<endl;
cout<<"8X10: "<<quan810<<endl;
cout<<"Frame(s): "<<quanf<<endl;
cout<<"Frames w/ 5X7: "<<quanf57<<endl;
cout<<"Is this Correct?\n(1)Yes\n(2)No\n";
cin>>correct;
}
price46=quan46*product[0];
price57=qaun57*product[2];
price810=quan810*product[4];
pricef=quanf*product[1];
pricef57=quanf57*product[3];
total=price46+price57+price810+pricef+pricef57;
cout<<"\nTotal Cost: "<<total<<endl;
break;
case 2:
cout<<"Please enter there ID number\n";
cin>>id2;
//Will then search for the id number in the output file.
break;
case 3:
cout<<"This is just a test case 3\n";
break;
default:
cout<<"Your entered an Invalid choice\n";
};
cout<<"Hopefully it works\n";
break;
}
return 0;
}
</code>