students data entry with c++ languge

hello, please send me a program with C++ : Student Information
1- It has a Function that save student name (over 100 names, length over 20 character) & Id (5 digits) & lessons (over 2 lessons) and end of data entry be -1 for id number.
2-It has a Function that get student information and sort by id.
3-It has a function that get id and if exist show informations 's student.
4- please with above function write a program.
thank a lot.
mssaburAsked:
Who is Participating?
 
mish33Commented:
The rule is: NO HOMEWORK SOLUTIONS.
Post what you have done so far and we can point you to the errors.

BTW this question shall be in C++ TA
0
 
mssaburAuthor Commented:
Please help me to improve my solution myself source is here:
#incloude <iostream.h>
#incloude <conio.h>

void getstu (char,char,int);
void sort (int);
void search(int&);

class charlesson:
{
      private:
      char lsn1,lsn2;
      public:
            void showlsn()
            {
                  char ans=1
                  cout<<"Please Enter ID's student:"<<lsn1<<'\t'<<lsn2;      
                  cin>>stuId;
                  
            }
      

}
//FONCTIONS
void getstu (char[20] name,charlessson lsn, int stuId)
{
      
}
void sort (int stuId);
{
      //sort
}
void search(int& stuId)
{
      //binary search      
}
//END FONCTIONS
int main()
{
      char ans1='y'
      char ans2='y'
      int count=1;
      cout<<"Pleas enter student's informations\n"
      
      while(count<=100)
      {
            getstu();      
            count+=1;
            if (cout>100) cout<<"Sorry stongly we shall only up to 100 student
 registrated.";
            break  ;
      }            
      cout<<"Would you like to have a quick sort? Please enter (y/n)";
      cin>>ans1;
      if (ans1=='y'|| ans1=='Y')
      {
            sort();
      
      else break;
      }
      cout<<"Would you like to have a quick search? Please enter (y/n)";
      cin>>ans2;
      if (ans2=='y'|| ans2=='Y')
      {
            search();
      
      else break;
      }                                    

return(0);
}
//Please  help to complete, so it has very error
0
 
mish33Commented:
Don't forget to end _each_ statement with ';' !

Start with data structure to hold your student info. Safe bet is list<studentinfo*>.
Then define class studentinfo (I think it's a more meaningful name than charlesson). It should has 5-digit id (99999 - use unsigned int or long), name, lesson1, lesson2 data members
and members for sorting (compare) and printing student info. Don't forget destructor to deallocate data.

getstu() better return studentinfo* (NULL for id==-1) and you can push_back it to the list.
For sorting use STL sort based on bool studentinfo::idsorted(const studentinfo* si1, const studentinfo* si2).

Post your progress.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.