Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

My code is having a error. the error is expected unqualified-id before [ token#include at 180:1 please fix the code so it will run in

My code is having a error. the error is expected unqualified-id before [ token#include at 180:1

please fix the code so it will run in c++ #include #include #include #include #include #include using namespace std; struct Person { string firstName; string lastName; string phoneNumber; }; struct Address { string street; string city; string state; int zip_code; }; struct Customer { Person person; Address address; }; void OpenInputFile(ifstream&); void OpenOutFile(ofstream&); void PrintHeadingOutput(ofstream&); void PO(Customer&, ofstream&); bool RIF(Customer&, ifstream&); int main() { ifstream inFile; ofstream outFile; Customer info; OpenInputFile(inFile); OpenOutFile(outFile); PrintHeadingOutput(outFile); while(RIF(info,inFile)) { PO(info,outFile); } if (inFile.fail() && !inFile.eof()) { string infilename; cout<<" Processing information. Please wait...."< An error has occured while reading "; cout << "==> the input file. Error in file content " << infilename < Terminating program!!!"<> infilename; cin.ignore(INT_MAX,' '); cout << infilename << endl; inFile.open(infilename.c_str()); while (inFile.fail()) { cout << endl << string(15,'*') << "File Open Error"< Input file failed to open properly!! "; cout << "==> Attempted to open file: " << infilename < Please try again... "; cout << string(47, '*')<< endl<> infilename; cin.ignore(INT_MAX,' '); cout << infilename << endl; inFile.open(infilename.c_str()); }

} void OpenOutFile(ofstream& outFile) { string outfilename; cout << " Enter name of output file:"; cin >> outfilename; cin.ignore(INT_MAX,' '); cout << outfilename << endl; outFile.open(outfilename.c_str()); while (outFile.fail()) { cout << endl << string(15,'*') << "File Open Error"< Output file failed to open properly!! "; cout << "==> Attempted to open file: " << outfilename < Please try again... "; cout << string(47, '*')<< endl<> outfilename; cin.ignore(INT_MAX,' '); cout << outfilename << endl; cout<<" Processing information. Please wait...."<> info.address.zip_code; inFile.ignore(INT_MAX,' '); getline(inFile, info.person.firstName,' '); return bool(inFile); } void PrintHeadingOutput(ofstream& outFile) { outFile << setw(7) << left <<"Entry"<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago