Question
I need to know how to input the following code into the complier for C++ code. // Start // Declarations // InputFile inFile1; // InputFile
I need to know how to input the following code into the complier for C++ code.
// Start
// Declarations
// InputFile inFile1;
// InputFile inFile2;
// OutputFile outFile1;
// num mClientNumber, fClientNumber
// string mClientName, fClientName
// bool atLeastOneFileNotAtEnd = true
// bool inFile1Written = false
// bool inFile2Written = false
// output "File merge processing starting"
// open inFile1 "MaleClients.rtf"
// open inFile2 "FemaleClients.rtf"
// open outFile1 "MergedClients.rtf"
// read mClientNumber and mClientName from inFile1
// read fClientNumber and fClientName from inFile2
// while ( atLeastOneFileNotAtEnd == true )
// if (inFile1 is EOF)
// if (inFile2Written == false)
// output fClientNumber, fClientName to Outputfile
// inFile2Written = true
// endif
// else if (inFile2 is EOF)
// if (inFile1Written == false)
// output mClientNumber, mClientName to Outputfile
// inFile1Written = true
// endif
// else if (mClientNumber < fClientNumber)
// output mClientNumber, mClientName to Outputfile
// inFile1Written = true
// else
// output fClientNumber, fClientName to Outputfile
// inFile2Written = true
// endif
//
//
// if ((inFile1 not EOF) AND (inFile1Written == true))
// read mClientNumber and mClientName from inFile1
// inFile1Written = false
// endif
// if ((inFile2 not EOF) AND (inFile2Written == true))
// read fClientNumber and fClientName from inFile2
// inFile2Written = false
// endif
// if ((inFile is EOF) AND (inFile2 is EOF))
// atLeastOneFileNotAtEnd = false
// endif
// endwhile
// close inFile1
// close inFile2
// close outFile1
// output "Merging Complete"
// Stop
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started