Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

C++ Programming

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

4. a) a a Fig. 4-B below describes main 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, currentGPA, and is Local data (Hint: function strto Primitive () in Qn 3 can also be used to help you!) store the InternApplicantType variable info into a vector retum a vector 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 readAndstoreInternApplicant Records () based on the function prototype signature as shown below: vector readAndStore InternApplicantRecords (string filename) (6 marks) (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 marka) name; university; email;current GPA; is Local 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 costream> #include #include #include Fig. 4-B using namespace std; struct InternApplicant { string name, university, email; float current GPA; bool is Local; string toString(); // readAndStoreInternApplicant Records (string filename); Assuming the code for splitstrTovecofstr() and strto Primitive) are implemented here! int main() string filename = "InternApplicant.txt": vector InternApplicantRecs = readAndstoreInternApplicant Records (filename); for (int i=0; i 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 readAndstoreInternApplicant Records () based on the function prototype signature as shown below: vector readAndStore InternApplicantRecords (string filename) (6 marks) (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 marka) name; university; email;current GPA; is Local 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 costream> #include #include #include Fig. 4-B using namespace std; struct InternApplicant { string name, university, email; float current GPA; bool is Local; string toString(); // readAndStoreInternApplicant Records (string filename); Assuming the code for splitstrTovecofstr() and strto Primitive) are implemented here! int main() string filename = "InternApplicant.txt": vector InternApplicantRecs = readAndstoreInternApplicant Records (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

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 And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 2 Lncs 13427

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124251, 978-3031124259

More Books

Students also viewed these Databases questions