Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Complete all the accessors (get) and the transform (set) member functions for

ID: 3527372 • Letter: 1

Question

1. Complete all the accessors (get) and the transform (set) member functions for all public and private data members. 2. Create a file (infile.txt) containing data for 5 students. 3. Create (declare) an array of 10 StudentType objects. 4. Read the file and populate the array. #include #include using namespace std; //specification section class StudentType { public: StudentType(); string myname; string myphone_no; char classification; void setName(string); void setPhone(string); void setClass(char); string getName(); string getPhone(); private: string ID; string SSN; float EFC; float GPA; }; //implementation section StudentType::StudentType()//constructor { myname = " "; myphone_no = " "; classification = ' '; }

Explanation / Answer

1st program 1: // Demonstrates declaration of a class and 2: // definition of an object of the class, 3: 4: #include // for cout 5: 6: class Cat // declare the class object 7: { 8: public: // members which follow are public 9: int itsAge; 10: int itsWeight; 11: }; 12: 13: 14: void main() 15: { 16: Cat Frisky; 17: Frisky.itsAge = 5; // assign to the member variable 18: cout