One day a store sold 31 sweatshirts. White ones cost $11.95 and yellow ones cost $12.50. In all, $379.80 worth of sweatshirts were sold. How many of each color were sold?

white ones ---- x

yellow ones ---- 31 - x

solve for x

11.95x + 12.50(31-x) = 379.80

To solve this problem, we need to create a system of equations based on the given information. Let's represent the number of white sweatshirts as "w" and the number of yellow sweatshirts as "y".

From the first piece of information, we are told that a total of 31 sweatshirts were sold. This can be written as an equation:
w + y = 31 (Equation 1)

The second piece of information tells us the cost of each sweatshirt, the number of white sweatshirts, and the number of yellow sweatshirts. We can calculate the total cost of the white sweatshirts by multiplying the cost per white sweatshirt ($11.95) by the number of white sweatshirts (w). Similarly, we can calculate the total cost of the yellow sweatshirts by multiplying the cost per yellow sweatshirt ($12.50) by the number of yellow sweatshirts (y). Adding these two amounts will give us the total cost of all sweatshirts sold, which is given as $379.80. We can represent this information as a second equation:
11.95w + 12.50y = 379.80 (Equation 2)

Now, we have a system of two equations (Equation 1 and Equation 2) with two variables (w and y) that we can solve simultaneously to find the values of w and y.

This can be done using various methods such as substitution or elimination. Let's use the elimination method to solve this system of equations.

First, we need to eliminate one of the variables. We can multiply Equation 1 by 11.95 to make the coefficients of w in both equations the same:
11.95w + 11.95y = 11.95 * 31
11.95w + 12.50y = 379.80

Now, subtract the first equation from the second equation:
(11.95w + 12.50y) - (11.95w + 11.95y) = 379.80 - (11.95 * 31)

Simplifying the equation gives:
12.50y - 11.95y = 379.80 - 371.45

Combining like terms gives:
0.55y = 8.35

Now, divide both sides of the equation by 0.55 to solve for y:
y = 8.35 / 0.55

Calculating:
y = 15

Now that we have the value of y, we can substitute it back into Equation 1 to solve for w:
w + 15 = 31

Subtracting 15 from both sides:
w = 31 - 15

Calculating:
w = 16

Therefore, there were 16 white sweatshirts and 15 yellow sweatshirts sold.