Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Cupid matchmaking Service maintains two files - one for the male clients and another for female clients. Each file contains a client ID, last

The Cupid matchmaking Service maintains two files - one for the male clients and another for female clients. Each file contains a client ID, last name, first name, and address. Each file is in client ID order. Use the provide pseudocode to write a C++ application that merges the two files into one file containing a list of all clients, maintaining ID member order.

// Pseudocode Project8

// 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

In the FemaleClients File:

21 Barbara_Jones

82 Sue_Todd

275 Mary_Donald

276 Cathy_Conner

300 Debbie_Baker

400 Kim_Tanner

In the MaleClients file:

56 Bob_Johnson

100 Dan_Smith

200 Mike_Tay

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

b. What are its goals and objectives?

Answered: 1 week ago