Trying to write to a file a person's name first and last then there telephone number. I want the program to loop until the user enters "quit" for the name.
I want to store the name as in the format First Last. And the phone number as example: (734)555 1212. Displaying contents when user enters quit.
Here is what I have so far. I know I need to use a loop for entering the data and loop until the user enters quit.
Stuck on what to do for formatting and what to use for the loop.
Consider using a string for the phone number, as you are using 7-10 digits and this will show up as a exponent. And since you won't be doing any mathematical functions with them.
As for the text file,
1 2 3
cout << "Enter your first name: " << endl;
cin >> nameFirst;
outputFile<<nameFirst<<endl;
Yes that worked and made more sense. I want the user inputs to loop until the user enters the word quit. I tried using a while loop to do this and think that my test expression is faulty. I also want to format the telephone number in a (313) 545-5544 format and are unsure how to do this.
Here is my changed code.