the price of a hat is $12. The price of a scarf is $14. I spent $128 on 10 items. How many hats did I buy?

h + s = 10 ... s = 10 - h

12 h + 14 s = 128

substituting
... 12 h + 14(10 - h) = 128
... 12 h + 140 - 14 h = 128
... -2 h = -12

Let's assume you bought x hats.

The cost of each hat is $12, so the total cost of hats will be 12x dollars.

The cost of each scarf is $14, so the total cost of scarves will be 14(10 - x) dollars.

You spent a total of $128 on 10 items, so we can set up the equation:

12x + 14(10 - x) = 128

Now, let's solve this equation step by step:

Step 1: Distribute the 14 across the terms inside the parentheses:

12x + 140 - 14x = 128

Step 2: Combine like terms (x terms):

-2x + 140 = 128

Step 3: Subtract 140 from both sides of the equation to isolate the variable term:

-2x = 128 - 140

-2x = -12

Step 4: Divide both sides of the equation by -2 to solve for x:

x = -12 / -2

x = 6

Therefore, you bought 6 hats.

To determine the number of hats you bought, we need to set up equations based on the given information.

Let's assume the number of hats you bought is represented by variable "h," and the number of scarves is represented by variable "s."

From the given information, we know the following:

1. The price of a hat is $12, so the total cost of hats is 12h.
2. The price of a scarf is $14, so the total cost of scarves is 14s.
3. You spent $128 on 10 items, so the total cost of all items is $128.

Based on these three equations, we can form the equation:

12h + 14s = 128 .....(Equation 1)

Since you want to know the number of hats bought, we can set up a second equation based on the fact that you bought a total of 10 items:

h + s = 10 .....(Equation 2)

Now we have a system of two equations (Equation 1 and Equation 2). We can solve this system to find the value of "h" (the number of hats bought).

We can solve these equations using substitution or elimination.

Let's solve using substitution. From Equation 2, we have s = 10 - h. We can substitute this value for "s" in Equation 1:

12h + 14(10 - h) = 128

Let's simplify this equation:

12h + 140 - 14h = 128
-2h = 128 - 140
-2h = -12
h = (-12)/(-2)
h = 6

Therefore, you bought 6 hats.