hi guy's , iam a new member i got stuck with my c++ assigment. i really want's your help
the program reads in a series of student data sets from the keyboard, stores
them in an ordered linked list of records, supports editing an existing record, and displays a
summary of all students entered. Each student’s record should contain the following fields:
First name
Last name
ID #
Midterm grade
Final Exam Grade
The linked list should be sorted by last name. The program should be menu driven, with the
following menu options:
Enter new student
Edit existing student (search by name)
Display list
Exit
The following details apply:
- Each student data record should be dynamically allocated
- The records should be stored in a linked list
- The records in the linked list should be sorted alphabetically by last name
- When editing is selected, the user should be prompted for the last name of the student record to edit.
--------------------------
this is what i wrote so far
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
#define SIZE 100
char ans;
int main ()
{
cout <<" Welcome to bos3ayed C++ writer company "<<endl;
cout << " this program help you to orginzing your student information";
cout<<". first name , last name , ID, first midterm grade, and final"<<endl;
cout <<endl<<endl;
cout<< "Choose what do you want to do from this menu (a,b,c,d)"<<endl;
cout<<"a) Enter new student"<<endl;
cout<<"b) Edit existing student ( serch by name)"<<endl;
cout<<"c) Display list "<<endl;
cout<<"d) Exit"<<endl;
cin>> ans;
}
class student_list
{
private:
char First_name [SIZE];
char Last_name [SIZE];
int ID;
float mid_grade,final_grade;
public:
student_list *next;
};
student_list::student_list() {
student_list *temp , *head;
temp = new student_list; // dynamiclly allocationg
temp -> next = NULL;
cout << "Enter student first name "<<endl;
cin >> temp-> First_name;
cout << "Enter student last name "<<endl;
cin>> temp-> Last_name;
cout<< "please enter student ID "<<endl;
cin>>temp->ID;
cout<<"please enter midterm grade"<<endl;
cin>> temp->mid_grade;
cout<<"please enter final grade"<<endl;
cin>> temp->final_grade;
}
student_list *head,*ptr,*tmp;
head=NULL;
while () {
ptr=new student_list;
temp=head;
head=ptr;
head->next=tmp;
}
----------------------------
thanks in advance;