CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2010
    Posts
    3

    Assistance needed.. C++ program [structures, functions..]

    Hello there!

    A very close friend of mine asked me for help a few days ago regarding a C++ program and I thought I could help him. Unfortunately the program seems a bit too complicated for me and that's why I ask for your assistance!

    I'd really appreciate if any of you could help me or at least give me some tips and guidelines

    Ok, here's a brief describtion of my friend's assignment:


    Write a program that stores information (something like a a database i guess) about teachers. Include the following:
    1) Class;
    2) First name of the teacher;
    3) Family name;
    4) School name;
    5) Years of service.

    The program should be able to perform the following tasks:

    1. Creating the so-called database on start (at least 20 entries required) and storing them on a separate file called "prep.txt".

    2. Printing the data on the screen.

    3. Include the following Options:

    > adding new entries;
    > editing current entries using the following filters:
    1) class;
    2) teacher's family name;
    3) teacher's years of service.

    >deleting entries using the following fileters:
    1) class;
    2) teacher's family name;
    3) teacher's years of service.

    >sorting entries by:
    1)teacher's family name (asc);
    2)years of service (desc).

    4. Making References to:

    > all teachers teaching the same class;
    > all teachers with years of service > 5 y.;
    > all math teachers (stored on separated file - "matem.txt").

    _____________________________________________________________


    The describtion ain't very clear but thats the exact assignment.. By the way, there's no requirement for the program to use Windows interface (thank God).


    I tried using structures and I managed to save the information on a separated file and print it on the screen.

    For the so called options menu I used a switch case statement and functions but all I could do was the part about adding new entries.. To be honest I don't really know how to do the rest..

    Any help, tips, guidelines etc. would be more than welcome! I apologise for bothering you with that stuff but I really don't know what to do and I promised my friend to do it for him, he really needs some assistance right now..

    Thank you all in advance!

    David

    PS: If it's not too much to ask for, I would really really appreciate if anyone could post the source code, I've been trying to do it for over a week or so and spent some sleepless nights on it but unfortuantely my efforts have been in vain..

  2. #2
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,513

    Re: Assistance needed.. C++ program [structures, functions..]

    If you look around this board, there have been hundreds of posts about more or less this exact exercise. It's basic textbook exercise. Since you don't have a real question, I don't have an answer for you.

    The only thing I will say though is that if you are not storing your data in one of the standard containers, then you are probably doing it wrong.

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Assistance needed.. C++ program [structures, functions..]

    See my post here:
    http://www.codeguru.com/forum/showpo...9&postcount=15
    for an example of how a similar problem could be solved very cleanly.

  4. #4
    Join Date
    Apr 2010
    Posts
    3

    Re: Assistance needed.. C++ program [structures, functions..]

    thank you for the fast reply..

    unfortunately since I started studying law I havent't had the time to continue with my c++ training so I'm still pretty much a beginner..

    anyway I'll try searching the forums for similiar threads, I guess

  5. #5
    Join Date
    Apr 2010
    Posts
    3

    Re: Assistance needed.. C++ program [structures, functions..]

    Quote Originally Posted by Lindley View Post
    See my post here:
    http://www.codeguru.com/forum/showpo...9&postcount=15
    for an example of how a similar problem could be solved very cleanly.
    thanks! i'll check it asap :]

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured