-1

Obviously, it should be titled: "Steak and Chicken Dinner Problem"

A wedding reception will have 200 guests and the dinner budget is $9,000.

Wedding Catering Prices:
===================
Chicken Dinner: $40
  Steak Dinner: $50

What is the highest number of steak dinners you can serve at this reception, and stay within the budget?

Let x = maximum number of steak dinners.

Now express the number of chicken digits, in terms of the number of the
number of steak dinners.

Cost per steak dinner * number of steak dinners + cost per chicken dinner(200 - x) = 9,000
=========================================================================

50x + 40(200-x) = 9,000
50x + 8000 -40x = 9,000
10x + 8000 = 9,000
10x = 1,000
x = 100
	 
steak dinners   = 100 
chicken dinners = 100
	 
100 * 50 = 5,000
100 * 40 = 4,000
================
200       $9,000

Could we squeeze in just one more steak dinner?

101 * 50 = 5050
 99 * 40 = 3960
===============
200       $9,010 (nope, over budget)

This would be done in just a few lines of code, using the above math. A short and sweet way to solve this kind of problem.

Edited by Adak: Steak and Chicken Dinner Problem

2
Contributors
2
Replies
7
Views
5 Years
Discussion Span
Last Post by Adak
0

Just do the same math: In any case, guests * cost_of_chicken must be spent. The rest, that is budget - guests * cost_of_chicken may be used to pay an excess price of steak, that is price_of_stake - price_of_chicken.

steaks = (budget - guests * cost_of_chicken) / (price_of_stake - price_of_chicken)

Am I missing something?

Edited by nezachem: n/a

0

This is a problem with two unknown but related, values. You can define either the number of chicken dinners in terms of the number of steak dinners, (as I did), or you can define the number of steak dinners in terms of the number of chicken dinners.

Either way, you can get the answers you need. ;)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.