Question: Previous Program Code #include #include using namespace std; // Define Student structure (email, firstName, lastName) struct Student{ string email, firstName, lastName; }; Student allStudents[100]; int

 Previous Program Code #include #include using namespace std; // Define Student

Previous Program Code

#include #include

using namespace std;

// Define Student structure (email, firstName, lastName) struct Student{ string email, firstName, lastName; };

Student allStudents[100]; int numStudents = 0;

int main(){ // open the text file for reading ifstream cinn; cinn.open("studentData.txt"); while(!cinn.eof()){ // create a Student variable Student s; // read data from file into Student structure elements cinn >> s.email; cinn >> s.firstName; cinn >> s.lastName;

// store Student variable in the array allStudents allStudents[numStudents++] = s; }

for(int i=0;i

}

Redo the previews assignment (2) using an Oriented Object approach. Your program should have at least two classes: a Student Class (Student Info) and a StudentFactory Class (That create a Student Array from a text File) Here are the header files for those two classes class Student private: string email; string fName; string IName; public: Student Student (string, string, string); void setEmail (string) void setFName (string); void setLName (string); string getEmail); string getFName ); string getLName ) class StudentFactory private: Student studentArray [100] int studentCount 0 public: StudentFactory (string); Student *getstudentArray) void showStudentList ) Your main function should include create a StudentFactory Object and call its showStudentList) method Please comment your code (it counts for 10pts)

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!