students data entry with c++ languge

Posted on 2007-08-12
Last Modified: 2013-11-25
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.
Question by:mssabur
    LVL 15

    Accepted Solution

    Post what you have done so far and we can point you to the errors.

    BTW this question shall be in C++ TA

    Author Comment

    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:
          char lsn1,lsn2;
                void showlsn()
                      char ans=1
                      cout<<"Please Enter ID's student:"<<lsn1<<'\t'<<lsn2;      

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

    //Please  help to complete, so it has very error
    LVL 15

    Expert Comment

    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.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Is there a 32-bit & 64-bit version of Mac Office 2016? 8 48
    An API detour question 7 38
    noX challenge 17 55
    Path of Workbook 3 30
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    A short article about problems I had with the new location API and permissions in Marshmallow
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now