Thread: Help Needed On A Program

  1. #46
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    This is the formula for the maximum number of steak dinners, which I linked you to on page one of this thread:

    Maximum stkdinners = (budget - chkcost(guests))/(stkcost-chkcost)

    What you need however, is the minimum number of guests to order the chicken dinner.

    How would you suggest rearranging or changing the above equation, to get that answer?

  2. #47
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Adak View Post
    This is the formula for the maximum number of steak dinners, which I linked you to on page one of this thread:

    Maximum stkdinners = (budget - chkcost(guests))/(stkcost-chkcost)

    What you need however, is the minimum number of guests to order the chicken dinner.

    How would you suggest rearranging or changing the above equation, to get that answer?
    Ummm... not to complicate things but wouldn't this have to be based on some kind of statistical information about who orders what across a large number of weddings? I'm aware this is just an exercise, but does it give enough information to actually solve the problem?

  3. #48
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Yes, it does give all the info you need. You have to (at least I did) think in terms of Algebra, solving one variable in terms of the other, and then working from that.

    There is a way to do it directly in arithmetic, but that takes *real* arithmetic, and that was a long time ago.

    The simple answer for me, since the first problem like this needed the maximum number of steak dinners possible, was simply:

    minimum chicken dinners = guests - maximum steak dinners

    It's a given in the problem, that the budget and guests will have values such that guests * cost of chicken dinner will be < budget for the reception dinner, and guests * cost of steak dinner will be > budget.
    Last edited by Adak; 09-11-2011 at 05:21 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Program solution needed...
    By vijay.neo in forum C Programming
    Replies: 6
    Last Post: 10-18-2006, 11:12 PM
  2. Some help needed with program.
    By ajdspud in forum C++ Programming
    Replies: 2
    Last Post: 12-06-2005, 03:36 PM
  3. Help needed with program.
    By ajdspud in forum C++ Programming
    Replies: 6
    Last Post: 11-22-2005, 04:05 PM
  4. Program crashes...help Needed!!
    By butterfly in forum C++ Programming
    Replies: 4
    Last Post: 05-31-2002, 11:22 AM
  5. redirection program help needed??
    By Unregistered in forum Linux Programming
    Replies: 0
    Last Post: 04-17-2002, 05:50 AM

Tags for this Thread