Thread: Overthinking Math...

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    81

    Cool Overthinking Math...

    Yeah so it's been a long day and I'm trying to think of an equation to solve this situation but I'm tired, it's extra credit, and I really can't concentrate.

    Here's the diagram http://i52.tinypic.com/144bnva.jpg

    My goal is, given a user input of length and width of the room, radius of the tables, space between each table / wall, and number of people per table, how many people does the arrangement fit.

    When there is no offset row of tables as in the tables look like
    OOOO
    OOOO

    the equation to find the amount of people is
    Code:
     
    int tables_across = (room_length-space)/(table_radius*2+space);
    int tables_wide = (room_width-space)/(table_radius*2+space);
    printf("This arrangement seats %d people.\n", tables_across*tables_wide*people_table);
    I need to find an equation that does the same thing, but with the offset row incorporated. Sorry if this doesn't make sense.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You wouldn't by any chance be this guy: Help Needed On A Program ... or just in the same class?


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Of course it's not that guy... this one's tables are round...

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by CommonTater View Post
    Of course it's not that guy... this one's tables are round...
    *cough* problem2 *cough*


    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Registered User
    Join Date
    Sep 2011
    Posts
    81
    LOL. I didn't even see that post. Also I didn't know there was a homework policy, guess it helps to read before I post. Oh well, thanks anyways.

  6. #6
    Registered User
    Join Date
    Sep 2011
    Posts
    81
    Hey, I never figured out the equation to the Extra Credit and it was due on tuesday, so I was wondering if NOW, since I can't turn it in even if I had it, you could help me with the equation.

  7. #7
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Well... post up some code... what have you tried?

  8. #8
    Registered User
    Join Date
    Sep 2011
    Posts
    81
    Nvm I figured it out. It was due to typos .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Some Math
    By jack_carver in forum C++ Programming
    Replies: 5
    Last Post: 09-13-2009, 12:15 AM
  2. math.h
    By tsutharssan in forum C Programming
    Replies: 3
    Last Post: 07-03-2009, 02:24 PM
  3. SSE math
    By KBriggs in forum C Programming
    Replies: 13
    Last Post: 06-17-2009, 11:11 AM
  4. Basic Math Problem. Undefined Math Functions
    By gsoft in forum C Programming
    Replies: 1
    Last Post: 12-28-2004, 03:14 AM
  5. Gah! More math!
    By BMJ in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 10-02-2002, 09:33 PM