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

/* cout << \"\ What is student\'s first name? \"; cin >> first; aList.info.setFi

ID: 3653251 • Letter: #

Question

/* cout << " What is student's first name? "; cin >> first; aList.info.setFirstName(first); <------ // This part is where i am going wrong the most !! cout << " What is the student's last name? "; cin >> last; aList.info.setLastName(last); */

Explanation / Answer

#include using namespace std; class linklist { private: struct node { int data; node *link; }*p; public: linklist(); void append( int num ); void add_as_first( int num ); void addafter( int c, int num ); void del( int num ); void display(); int count(); ~linklist(); }; linklist::linklist() { p=NULL; } void linklist::append(int num) { node *q,*t; if( p == NULL ) { p = new node; p->data = num; p->link = NULL; } else { q = p; while( q->link != NULL ) q = q->link; t = new node; t->data = num; t->link = NULL; q->link = t; } } void linklist::add_as_first(int num) { node *q; q = new node; q->data = num; q->link = p; p = q; } void linklist::addafter( int c, int num) { node *q,*t; int i; for(i=0,q=p;ilink; if( q == NULL ) { coutlink; delete q; return; } r = q; while( q!=NULL ) { if( q->data == num ) { r->link = q->link; delete q; return; } r = q; q = q->link; } cout