Advertisement
jamesonBradfield

Student.cpp

Dec 20th, 2023
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.12 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #include "Student.h"
  5. #include "degree.h"
  6.  
  7. Student::Student(string studentId, string firstName, string lastName, string emailAddress, int age, int daysInCourse0, int daysInCourse1,int daysInCourse2, DegreeProgram degreeProgram) {
  8.     Student::SetStudentId(studentId);
  9.     Student::SetFirstName(firstName);
  10.     Student::SetLastName(lastName);
  11.     Student::SetEmailAddress(emailAddress);
  12.     Student::SetAge(age);
  13.     Student::SetDaysInCourse(0,daysInCourse0);
  14.     Student::SetDaysInCourse(1,daysInCourse1);
  15.     Student::SetDaysInCourse(2,daysInCourse2);
  16.     Student::SetDegreeProgram(degreeProgram);
  17. }
  18.  
  19. Student::~Student() {
  20.     //delete this->studentID;
  21.     //delete this->firstName;
  22.     //delete this->lastName;
  23.     //delete this->emailAddress;
  24.     //delete this->age;
  25.     delete[] this->daysInCourse;
  26.     //delete this->degreeProgram;
  27. }
  28.  
  29. void Student::SetStudentId(string studentId) { studentId = studentId; }
  30. void Student::SetFirstName(string firstName) { firstName = firstName; }
  31. void Student::SetLastName(string lastName) { lastName = firstName; }
  32. void Student::SetEmailAddress(string emailAddress) { emailAddress = emailAddress; }
  33. void Student::SetAge(int age) { age = age; }
  34. void Student::SetDaysInCourse(int daysInCourseValue,int daysInCourseIndex) { daysInCourse[daysInCourseIndex] = daysInCourseValue; }
  35. void Student::SetDegreeProgram(DegreeProgram degreeProgram) { degreeProgram = degreeProgram; }
  36.  
  37. string Student::GetStudentId() {return studentID; }
  38. string Student::GetFirstName() {return firstName; }
  39. string Student::GetLastName() { return lastName; }
  40. string Student::GetEmailAddress() { return emailAddress; }
  41. int Student::GetAge() { return age; }
  42. int Student::GetDaysInCourse(int index) { return daysInCourse[index]; }
  43. DegreeProgram Student::GetDegreeProgram() { return degreeProgram; }
  44.  
  45. void Student::Print() {
  46.     cout << studentID << "\t" << " First Name : " << firstName << "\t"
  47.         << " Last Name : " << lastName << "\t" << " Age : " << age
  48.         << "\t" << "daysInCourse : " << "{" << daysInCourse[0] << "," << daysInCourse[1] << "," << daysInCourse[2] << "}" << "\t"
  49.         << "Degree Program : " << degreeProgram << ".";
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement