Skip to main content

Posts

Showing posts with the label CS301

CS301 Assignment no1

        CS301 - Assignment   1   Solution   Spring   2021   #include <iostream> #include <string> #include <iostream> #include <string> #include <sstream> using namespace std; class node{ public: std::string name; short int coursecode; node* ptr; }; class student{ private: node* head; public: student(){ head = '\0'; } void insertStu(node**,node*); void newNode(); void showAll(int code); }; void student:: insertStu(node** head,node* newNode){ node* current; if(*head=='\0'){ *head=newNode; }else{ current=*head; } while(current->ptr !='\0'){ current=current->ptr; } newNode->ptr=current->ptr; current->ptr=newNode; cout<<endl; cout<<"student information save successfully "; } void student:: newNode(){ short int courseC