Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++ Program: a a) Fig. 4-B below describes a maino program that invokes function readAndStore InternApplicantRecords () to : read in intern applicant's data

Using C++ Program:

image text in transcribed

image text in transcribed

a a) Fig. 4-B below describes a maino program that invokes function readAndStore InternApplicantRecords () to : read in intern applicant's data stored in a file with the filename that was passed in as argument extract the relevant pieces of information like name, university, email, etc of each applicant stored in the file (Hint: make use of the function splitstrtovecofstr() in Qn 2) initialize a InternApplicantType struct variable with the applicant's name, university, email, current GPA, and is Local data (Hint: function strtoPrimitive()in Qn 3 can also be used to help you!) store the InternApplicantType variable info into a vector retum a vector InternApplicantType> which contains the data of each applicant found in the file Based on the sample contents of file "InternApplicant.txt" in Fig. 4-A, assuming both splitstrtovecofstr() from Qn 2 and strToPrimitive () in Qn 3 are available in the main() program in Fig. 4-B, and the sample output as shown in Fig. 4-C, write the implementation code for the function readAndStoreInternApplicantRecords () based on the function prototype signature as shown below: vector readAndStoreInternApplicantRecords (string filename) (6 marks) b) Implement the toString() for struct InternApplicant, such that the program's output will appear as shown in Fig. 4-C, based on the sample contents of file "InternApplicant.txt" in Fig. 4-A (4 marks) name; university; email;currentGPA; islocal Robert Downey Jr; University of California;ironman@stark.com;3.8;0 Scarlett Johansson; University of Marvel;blackwidow@shield.com;3.6;1 Chris Evans;University of New York;captain america.com;3.3;0 Samuel L Jackson; University of Washington;nickfury@shield.com; 3.3; 1 Fig. 4-A #include #include #include #include #include Fig. 4-B using namespace std; struct InternApplicant { string name, university, email; float current GPA; bool is Local; string toString(); // readAndStore InternApplicantRecords (string filename); Assuming the code for splitstrtovecofstr() and strto Primitive () are implemented here! int main() { string filename = "InternApplicant.txt"; vector InternApplicantRecs = readAndStoreInternApplicantRecords (filename); for (int i=0; i

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_2

Step: 3

blur-text-image_3

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

What two hash functions are commonly used as digital fingerprints?

Answered: 1 week ago

Question

How does selection differ from recruitment ?

Answered: 1 week ago

Question

=+Where does the focus of labor relations lie? Is it collective

Answered: 1 week ago

Question

=+With whom does the firm have to negotiate?

Answered: 1 week ago