Good night every one ... when i run my program its write to the file for only once i mean when i enter for example :
firist name: jey
last name: adam
then loping and enter for another customer it write to the file only the data for jey !?
using namespace std;
cout << "Enter Mobile Number as ( 555 ) to STOP: ";
cin >> MobileNumber;
cout<<"Please enter your Firist Name: ";
cin >> FiristName;
cout << "Please enter your Firist Name: ";
cin >> LastName;
cout << "Please enter your Pacage Type";
cin >> Type;
cout << "Please enter how many MG you have been consumed:";
cin >> MB;
customer << MobileNumber << '\t' << FiristName <<'\t' << LastName <<'\t' << Type << "\t"<< MB << endl;
FIRST: When you post code here, please use code tags under the format options. Thx
You misspelled First.
also I'm not sure but Pacage, may be spelled Package.
That is not the problem of course. Just wanted to point that out.
Your program tells users to type in the number as (123)456-7890 which is ok, but "()-" are not numbers. Therefor you can not use MobileNumber as a double, int, float or any other numeric value. you can use it as a string, or maybe char. And that seems to be the problem.