Could u rewrite this w/o using this
- User
Could u rewrite this w/o using this
- Assistant
Could you rewrite this without using "this"?
- User
Student::Student()//empty Constructor
{ this->studentID = ""; this->firstName = ""; this->lastName = ""; this->emailAddress = ""; this->ageofStudent = 0; for (int i = 0; i < daystoComplete; i++) this->daystoComp[i] = 0; this->degreeProgram = DegreeProgram::UNKNOWN;
- Assistant
Student::Student() // Default Constructor { studentID = ""; firstName = ""; lastName = ""; emailAddress = ""; ageofStudent = 0; for (int i = 0; i < daystoComplete; i++) daystoComp[i] = 0; degreeProgram = DegreeProgram::UNKNOWN; } Student::Student(string studentID, string firstName, string lastName, string emailAddress, int ageofStudent, int daystoComp[], DegreeProgram degreeProgram) { this->studentID = studentID; this->firstName = firstName; this->lastName = lastName; this->emailAddress = emailAddress; this->ageofStudent = ageofStudent; for (int i = 0; i < daystoComplete; i++) this->daystoComp[i] = daystoComp[i]; this->degreeProgram = degreeProgram; } Student::~Student(){} // Destructor // Getters string Student::getID() { return studentID; } string Student::getFirstName() { return firstName; } string Student::getLastName() { return lastName; } string Student::getEmailAddress() { return emailAddress; } int Student::getAgeofStudent() { return ageofStudent; } int* Student::getDaystoComp() { return daystoComp; } DegreeProgram Student::getDegreeProgram() { return degreeProgram; } // Setters void Student::setID(string studentID) { this->studentID = studentID; } void Student::setFirstName(string firstName) { this->firstName = firstName; } void Student::setLastName(string lastName) { this->lastName = lastName; } void Student::setEmailAddress(string emailAddress) { this->emailAddress = emailAddress; } void Student::setAgeofStudent(int ageofStudent) { this->ageofStudent = ageofStudent; } void Student::setDaystoComp(int daystoComp[]) { for (int i = 0; i < daystoComplete; i++) this->daystoComp[i] = daystoComp[i]; } void Student::setDegreeProgram(DegreeProgram dp) { degreeProgram = dp; } void Student::printHeader() { cout << "Student ID|First Name|Last Name|Email Address|Age|Days to Complete Course|Degree Program\n"; } void Student::print() { cout << getID() << '\t'; cout << getFirstName() << '\t'; cout << getLastName() << '\t'; cout << getEmailAddress() << '\t'; cout << getAgeofStudent() << '\t'; cout << getDaystoComp()[0] << ','; cout << getDaystoComp()[1] << ','; cout << getDaystoComp()[2] << '\t'; cout << degreeProgramStrings[getDegreeProgram()] << '\n'; // Degree program to string } - User
this is what i had: #pragma once #include "Student.h"
- Assistant
- User
what things did u change
- Assistant