Like Tree5Likes

Help Needed On A Program

This is a discussion on Help Needed On A Program within the C Programming forums, part of the General Programming Boards category; This is the formula for the maximum number of steak dinners, which I linked you to on page one of ...

  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 06:21 PM.

Page 4 of 4 FirstFirst 1234
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-19-2006, 12:12 AM
  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, 12:22 PM
  5. redirection program help needed??
    By Unregistered in forum Linux Programming
    Replies: 0
    Last Post: 04-17-2002, 06:50 AM

Tags for this Thread


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