Question: Below is what I have so far, however adding nodes doesn't work of course. I need help creating a function to add a new node

 Below is what I have so far, however adding nodes doesn't

Below is what I have so far, however adding nodes doesn't work of course. I need help creating a function to add a new node for each student, and then add specific information for said student.

#include #include

using namespace std;

struct slist { slist *ptr; int studentID; //Student ID number string first; //Student first name string last; //Student last name string dob; //Student date of birth string email; //Student email address };

int main(int argc, char** argv) { //ptr = new slist; slist * first = NULL; slist * last = NULL; slist * p = new slist; //Creating the first node p->ptr = NULL; p->studentID = 101; p->first = "Peter"; first = p; last = p; //(in-class 'slist *' was deleted and worked) slist * q = new slist; q->ptr=NULL; q->studentID = 102; q->first = "Stan"; first->ptr=p; last = q; slist * r = new slist; r->ptr=NULL; r->studentID = 102; r->first = "Stan"; first->ptr=p; last = q;

return 0; }

or : https://docs.google.com/document/d/1OfkuNRDVpajsDbZq5sqYA4b1TVqsIA_3jYgkfmufxC0/edit?usp=sharing

Please write a C++ program: Create a C++ struct to include the following data fields using appropriate data types: Student ID Student First Name: Student Last Name DoB Student Email address; Create a link list using pointers so that the link list looks like the following diagram StudentID Student ID Student ID Student ID FirstName First Name FirstName FirstName LastName LastName LastName Last Name DoB DoB DoB DoB Emai Ema Emai Emai You must be able to do the following: Add a new node to the end of the list. Search the list by student last name, and return/print the student's information This program is intended for you to practice the use of pointers, functions, and C++ strings. You must use pointers, a function to add a new node, a function to search, and a function to display student information. You must also have the necessary code to allow the user to enter the new student information via the keyboard. All regular requirements apply

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!