Question: Write a C++ code that will read a file and store each piece of the information in a separate vector. After that, display the contents

Write a C++ code that will read a file and store each piece of the information in a separate vector. After that, display the contents of the vectors.

Two vectors required:

Vector A.) Student Full Name

Vector B.) Class Name

file.txt ********************

StudentA, Name1 ENGLISH I (ENG101) <30-st>

StudentB, Name2 SPANISH I (SPN121) (no-prereq) [TXTBOOK REQ]

StudentC, Name3 BIOLOGY GENERAL (BIO220/II) [Ms. McCortney]

StudentD, Name4 CHEMISTRY: ORG (ORCHEM122.2) [A student only] <20-change>

StudentE, Name5 ACCOUNTING (ACC-101) (split with ACC-101A) <8:45> DRAMA (OPT-DRAMA-211*) (classrooom R220)

StudentF, Name6 PE (SOCCER122) {John T.} [Him/His]

*********************

Student name start at the first character of the first line.

Students are separated from their class schedules by at least one tab.

The class name includes: Name and Class code in parenthesis. For example: DRAMA (OPT-DRAMA-211*)

If a student has multiple classes in their schedule, (except for the first line), all other lines will start with at least one tab.

Example:

StudentE, Name5 ACCOUNTING (ACC-101) (split with ACC-101A) <8:45> (tab here) DRAMA (OPT-DRAMA-211*) (classrooom R220)

Additional information stored in brackets or other parenthesis should be ignored.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!