OOP assignment

This is a discussion on OOP assignment within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I was given a Java assignment with a list of classes that should be included, but I'm thinking about getting ...

  1. #1
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218

    OOP assignment

    I was given a Java assignment with a list of classes that should be included, but I'm thinking about getting rid of a couple because they seem pointless. Basically I have to make a shopping trolley prog. The 4 classes given are:

    A Menu Class - which holds a list of items on the menu
    A Menu Item Class - which holds details of each item on the menu
    An Order Class - which holds a list of all items ordered
    An Order Item Class - which holds a reference of each item ordered from the menu along with quantity.

    Originally I coded my back end so that orders could be made from more than one menu, but apparently that was over complicating things as there would only be one menu, which made me think. If all items in an order ar drawn from the same menu, there is only one menu, and theres no point in having multiple 'order item' entries for the same 'menu item', then wouldent both the order, and order item class do nothing but complicate the program? Essentially there would be nothing notable left to differentiate the menu from an order. All I would have to do would be add a variable to each 'menu item' that holds the quantity sold and I could get rid of two of my classes. It seems to me as if that would greatly simplify the code. Is this a good idea? Its going against the spec, but it makes sense to me.

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,807
    When it comes to assignments, always follow the spec. Even when it seems dumb.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Menu
    By Krush in forum C Programming
    Replies: 17
    Last Post: 09-01-2009, 02:34 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Data Mapping and Moving Relationships
    By Mario F. in forum Tech Board
    Replies: 7
    Last Post: 12-14-2006, 09:32 AM
  4. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  5. recommendation for a good OOP book
    By Mario F. in forum C++ Programming
    Replies: 2
    Last Post: 06-15-2006, 04:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21