Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*** I just need help finishing this program off. I need a display function, that after you modify or delete a student info it displays

*** I just need help finishing this program off. I need a display function, that after you modify or delete a student info it displays on the screen***

#include #include #include #include using namespace std; bool check = true; struct node { char name[20]; int idNum; float gpa;

node *next; }*head,*lastptr;

void Add() //Add Student's Info// { node *p; p=new node; cout<<"Enter name of student:"<>p->name; fflush(stdin); cout<<"Enter Id Number of student:"<>p->idNum; fflush(stdin); cout<<"Enter GPA of student:"<>p->gpa; fflush(stdin); p->next=NULL;

if(check) { head = p; lastptr = p; check = false; } else { lastptr->next=p; lastptr=p; } cout<>id_Num; prev=head; current=head; while(current->idNum!=id_Num) { prev=current; current=current->next; } ptr=new node; fflush(stdin); cout<<"Enter name of student:"<name); fflush(stdin); cout<<"Enter ID number of student:"<>ptr->idNum; fflush(stdin); cout<<"Enter GPA of student:"<>ptr->gpa; fflush(stdin); prev->next=ptr; ptr->next=current->next; current->next=NULL; delete current; cout<>id_Num; prev=head; current=head; while(current->idNum!=id_Num) { prev=current; current=current->next; } cout<<" name: "; cout<name; cout<<" ID number:"; cout<idNum; cout<<" GPA:"; cout<gpa; getch(); } void Delete() //Deletes Student's Info// { node *ptr=NULL; node *prev=NULL; node *current=NULL; int id_Num; cout<<"Enter ID Number to Delete:"<>id_Num; prev=head; current=head; while(current->idNum!=id_Num) { prev=current; current=current->next; } prev->next = current->next; current->next=NULL; delete current; cout<

int main() { int choice; do { cout<<"Option: "<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions