Programme Help

Discussion in 'C++' started by gomerpyl3, Apr 30, 2004.

  1. gomerpyl3

    gomerpyl3 Guest

    I am trying to make a small system to record details for a small video
    / DVD shop - approx 200 members @ the mo

    I wanted it to be able to do the following:

    Check out a video / DVD
    Return video / DVD
    Add a new Video / DVD to stock
    Remove a Video / DVD from stock
    Display all Video / DVD in stock
    Display member details


    I've made the Menu, but I am stumped as to how I can go about the rest
    of the programmes & link them to the menu.

    Storage of the details would be in a number of *.dat files
    (hopefully).

    A the code for the menu is available @

    http://hometown.aol.com/gomerpyl3/myhomepage/index.html

    Any help is gratefully recieved.

    John
    gomerpyl3, Apr 30, 2004
    #1
    1. Advertising

  2. gomerpyl3

    osmium Guest

    gomerpyl3 writes:

    > I am trying to make a small system to record details for a small video
    > / DVD shop - approx 200 members @ the mo
    >
    > I wanted it to be able to do the following:
    >
    > Check out a video / DVD
    > Return video / DVD
    > Add a new Video / DVD to stock
    > Remove a Video / DVD from stock
    > Display all Video / DVD in stock
    > Display member details


    I assume this is a student exercise. The spec seems to be incomplete since
    there is no way to get an inventory of members. A good first guess is that
    you will want a video tape class and a member class. Take a stab at writing
    the class definitions (but not the member functions) for those two. Keep
    things simple; a couple of data items for each. You don't want this to
    degenerate into a typing class. If you can handle two things, you can
    probably handle n things. Note that neither class should be directly
    cognizant of the other class. I would expect you to end up with either an
    array, a vector or a list of objects. Two of them: one for tapes and one
    for members. Which you end up with is pretty much a function of how the
    course has been taught and the text book used and where you are in that
    text.

    Compile often. Just because you compile doesn't mean you have to also run a
    program.
    osmium, Apr 30, 2004
    #2
    1. Advertising

  3. gomerpyl3

    rossum Guest

    On 30 Apr 2004 09:07:39 -0700, (gomerpyl3) wrote:

    >I am trying to make a small system to record details for a small video
    >/ DVD shop - approx 200 members @ the mo
    >
    >I wanted it to be able to do the following:
    >
    >Check out a video / DVD
    >Return video / DVD
    >Add a new Video / DVD to stock
    >Remove a Video / DVD from stock
    >Display all Video / DVD in stock
    >Display member details
    >

    Very incomplete. Remember the acronym CRUD: Create, Read, Update,
    Destroy. Apply this to your two data types: Video/DVD and Member.

    >
    >I've made the Menu, but I am stumped as to how I can go about the rest
    >of the programmes & link them to the menu.

    Write a series of separate functions: check_out_video(/***/),
    return_video(/***/) etc. Make these functions public member functions
    of the appropriate class. Call them from your menu routine.


    >
    >Storage of the details would be in a number of *.dat files
    >(hopefully).

    You will need some write() functions and some read() functions for
    this. Again make them public member functions of the appropriate
    class.

    >
    >A the code for the menu is available @
    >
    >http://hometown.aol.com/gomerpyl3/myhomepage/index.html


    If your code is worth reading then it is worth cutting and pasting it
    into your post here.

    >#include <iostream.h>

    This is deprecated, use <iostream> (no ".h")

    >void main(void)

    main *always* returns int. Your compiler should have rejected this.
    (void) is unneccessary and often considered bad style.
    Change to "int main()"

    You should have spaces round operators for a better layout. An
    ability to indent HTML, or a quick google for a code to HTML utility
    would help.

    rossum

    >
    >Any help is gratefully recieved.
    >
    >John


    --

    The Ultimate Truth is that there is no Ultimate Truth
    rossum, Apr 30, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    380
    Scott Allen
    May 5, 2005
  2. Nobber

    Diary Programme?

    Nobber, Nov 18, 2005, in forum: Java
    Replies:
    2
    Views:
    431
    Monique Y. Mudama
    Nov 18, 2005
  3. HAK
    Replies:
    0
    Views:
    336
  4. Dumidu

    Help me to write a programme

    Dumidu, Feb 7, 2005, in forum: C++
    Replies:
    1
    Views:
    414
    Thomas Matthews
    Feb 7, 2005
  5. gganesh
    Replies:
    4
    Views:
    631
    maxim
    May 12, 2009
Loading...

Share This Page