Question: Figure 2 . Sample output. Student Records: Name: Peppa Pig Major: Engineering Minor: None - Yet Name: George Pig Major: Chemistry Minor: Sciences Name: Daddy
Figure Sample output.
Student Records:
Name: Peppa Pig
Major: Engineering
Minor: NoneYet
Name: George Pig
Major: Chemistry
Minor: Sciences
Name: Daddy Pig
Major: Sciences
Minor: NoneYet
Name: Mummy Pig
Major: Liberal Arts
Minor: Humanities
Name: Suzy Sheep
Major: Engineering
Minor: NoneYet
Name: Rebecca Rabbit
Major: Liberal Arts
Minor: NoneYet
Name: Pedro Pony
Major: Sciences
Minor: Liberal Arts
Lab Functions
The disk file c:tempstudentstxt contains a list of student records see Figure
Each student record is formatted as follows: the first line holds the character name, and the second line has two threedigit numbers. The first number represents the students' declared undergraduate school major, and the second
represents their minor program if any!
Table The following values are used to encode undergraduate programs.
NoneYet
Liberal Arts
Chemistry
Engineering
Sciences
Humanities
Law
Write a C program to read the student file and nicely print each student record. The app must include the following two functions
string getMajorMinorint numCode
For example, if you pass the argument it returns Engineering".
The second function is void getStudentRecordifstream& studentFile, string& studName, string& major, string& minor
This function reads the disk data, calls the getMajorMinor function to find the textual version of the student's major and minor and returns those three values to the caller.
Test the program with the data shown in Figure Figure shows a sample output.
Figure Student Records c:tempstudentstxt PLEASE DONT USE SWITCH STATEMENT FOR getMajorMinor Function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
