Thread: Need C help BAD!

  1. #1
    Unregistered
    Guest

    Question Need C help BAD!

    Help!! Im currently enrolled in an Advanced C class at my college. I've never had a problem with any other language i've studied so far, and i did fine in my first semester of C but now im at a loss. We have a final project due in 2 weeks and i need help. This is my last resort. I've tried setting up sessions of help with my professor but he does not have office hours and when emailing him, his response is never helpfull. I could go on, but the point is that i've looked everywhere for help and im hoping someone will read this and email me. Its not a very hard program to write from what i understand...but obviously i dont understand much. Heres a basic of what needs to be done:

    Write a program using a 2 dim array. You own a restaurant and need to write a program showing all tables/booths still available and which are smoking/nonsmoking. The user will enter his name and be able to set up a reservation for a specific type of table or booth with or without smoking.
    Im at a complete loss and have no where to turn...chances are i'll never find this faq again (im in class right now) so PLEASE email me at [email protected] if you can help....thanks to anyone that cares enough to help a desperate college student from failing

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Don't mind helping, although there isn't much any information to work with here. Still, there are some generic bits of information to know about here. First off, you probably want to represent each table as a set of elements describing the table...
    Code:
    typedef struct _table
    {
     int isSmoking;
     int nSeats;
     int isBooth;
     int isAvailable;
     // And so on...
    } TABLE;
    
    TABLE tArray[aspect][aspect];
    And I presume that your 2d array is going to be an array of tables.

    Also, you'll need a couble of functions...
    Code:
    void reserveTable(TABLE * table);
    void displayRestaurant (TABLE tables[][]);
    void freeTable (TABLE * table);
    TABLE * findTable (TABLE tables[][], int howMany, int smoking);
    So, using these functions, you could maybe reserve a table for two in smoking like this...
    Code:
    TABLE t;
    t = findTable (tArray, 2, TRUE);
    reserveTable (t);
    // And later, freeing up the table isn't too tough...
    freeTable(t);
    First off though, I suggest making a menu to handle all the different options for the user, and work your way down into the program.

    Still, please be more specific.
    Callou collei we'll code the way
    Of prime numbers and pings!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bad and fail of steam
    By George2 in forum C++ Programming
    Replies: 8
    Last Post: 02-19-2008, 03:07 AM
  2. Can you still view the bios screen with a bad CPU?
    By HyperCreep in forum Tech Board
    Replies: 4
    Last Post: 12-31-2006, 06:57 PM
  3. data loss bad bad bad
    By RoD in forum Tech Board
    Replies: 4
    Last Post: 05-01-2003, 12:06 PM
  4. Shocking(kind of)
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 25
    Last Post: 12-10-2002, 08:52 PM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM