Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago