in Visual C++, For this assignment you will write a simple class hierarchy and u
ID: 3722758 • Letter: I
Question
in Visual C++,
For this assignment you will write a simple class hierarchy and use functions to carry out common tasks across all child classes. The assignment problem: At UMKC, a file called "input.txt" contains all the faculty and students' data. Each line in this file starts with one of the following letters ('s', '). If the line starts with 's', that means this line represents a student (first name, last name, id, major). Otherwise, a faculty member (first name, last name, id, salary), StudentOutput.b FacultyOutput.bt Sourc f Zach Shiffer 180 18069.29 2 s lack Saith 182 Art f Toni Alberto 183 9880e.39 4 s 5ae Wael 184 History s Kin Watson 105 Math s Nancy Thonson 186 Geography 7 s Tim Jefferson 107 Art f Andrew 3azz 188 94080.55 f Kyle Zipp 109 68344.89 1e s Sam Anthony 118 Engineering You are asked to write a program that reads this input file and separate faculty from students then prints the output of each category to a separate output file. To keep track with each faculty member and each student we need to create an object for each one. To avoid repeating variables and functions, we will create a general class and call it "Members". This class contains the shared data that each student and faculty member should have (first name, last name, id). Our class should also have the following: A constructor that takes no arguments. . A constructor that takes three arguments to set the member variable: first name, last name, and id. Members(const string& firstName, const string& lastName, int idNum); . A print function "printMember" that prints first name, last name, and the id for the calling object. void printMember) const A function "readWriteMembers" that accepts an input file object and output file object to read and write members to files. (The definition in the Base class is not that important since we will use it to read student members or faculty members only). d readWriteMembers(fstream& instream, ofstream& outstream); Getters and setters for the first name, last name, and id.Explanation / Answer
Members.h
Student.h
student.cpp
Faculty.h
Faculty.cpp
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.