How are you every body?
I want from you to check this program..
**************************************************
Suppose that the file inData.txt contains the following data:
Sarah AlSammak alahliunitedbank bh
Write a C++ program that read from the inData file the first string as a first name, the second string as a last name, the third string as a company name and the last string as a country code. The aim of the program is to create an email for the user and store it in outData.txt file.
The email structure is:
Fname_lname@company_name.com.country_code
After the execution, the outdata.txt should contain:
email removed
************************************************** *******************
My soultion is:
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- #include<fstream>
- using namespace std;
- int main()
- {
- string Fname,lname;
- string company_name,country_code;
- char '@';
- ifstream infile;
- ofstream outfile;
- infile.open("inData.txt");
- outfile.open("outData.txt");
- infile>>Fname>>lname ;
- infile>>company_name>>country_code>>endl;
- outfile<<"Fname_lname"<<'@'<<"company_name"<<.com<<".country_code"<<endl;
- infile.close();
- outfile.close();
- return 0;
- }
{Thanks slots}