During a game, high school students sell snacks. They sell cold sandwiches for $2.50, hot dogs for $1.50, and hamburgers for $2. By the end of the day, the students have collected $1060.50 and sold 562 items. Casey estimates that the students sold twice as many hot dogs as cold sandwiches. If his estimate is correct, how many of each item did they sell? Solve by using row reduction.

Respuesta :

The answer is they sold 127 cold sandwiches, 254 hot dogs, and 181 hamburgers.

s - the number of sandwiches
d - the number of hot dogs
h - the number of hamburgers

The price for s number of sandwiches is: $2.50s
The price for d number of hot dogs is: $1.50d
The price for h number of hamburgers is: $2h

The students have collected $1060.50: $2.50s + $1.50d + $2h = $1060.50
The students have sold 562 items: s + d + h = 562
The students sold twice as many hot dogs as cold sandwiches: d = 2s

Let's use substitution method.
First, let's substitute d from the third equation into the second equation and solve it for h in the term of s:
s + d + h = 562
d = 2s
s + 2s + h = 562
3s + h = 562
h = 562 - 3s

Further, substitute h and d from the second and the third equations, respectively, into the first equation and solve it for s:
2.50s + 1.50d + 2h = 1060.50
d = 2s
h = 562 - 3s
2.50s + 1.50 * 2s + 2(562 - 3s) = 1060.50
2.50s + 3s + 1124 - 6s = 1060.50
-0.5s + 1124 = 1060.50
1124  - 1060.50 = 0.5s
63.5 = 0.5s
s = 63.5/0.5 = 127

d = 2s = 2 * 127 = 254

h = 562 - 3s = 562 - 3 * 127 = 562 - 381 = 181