Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. void Schedule::appendNoCheck(Course course)
  2. {
  3.    
  4.     Node* n = new Node(course);
  5.  
  6.     if (head == nullptr) {
  7.         head = n;
  8.     }
  9.     else {
  10.         Node* temp = head;
  11.         while (temp->next != nullptr) {
  12.             temp = temp->next;
  13.         }
  14.         temp->next = n;
  15.     }
  16.     this->totalCredits = this->totalCredits + course.getCredits();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement