Kate bought 3 CDs and 1 DVD at a store. Her friend Joel bought 2 CDs and 2 DVDs. If Kate spent $20 and Joel spent $22, determine the cost of a CD and DVD.

~Please provide an explanation as well.
Please and thanks!

cost of CD --- x

cost of DVD -- y

3x + y = 20 ---> y = 20-3x

2x + 2y = 22
x +y = 11
use substitution:
x + (20-3x) = 11
-2x = -9
x = 4.5
then y = 6.5

Let's assume the cost of a CD is represented by 'C' dollars and the cost of a DVD is represented by 'D' dollars.

According to the given information, Kate bought 3 CDs and 1 DVD, and Joel bought 2 CDs and 2 DVDs. We can set up the following equations based on their purchases:

Equation 1: 3C + 1D = 20
Equation 2: 2C + 2D = 22

To solve this system of equations, we can use a method called substitution.

From Equation 2, let's solve for C in terms of D:
2C = 22 - 2D
C = (22 - 2D)/2
C = 11 - D

Now, substitute this value of C into Equation 1:
3(11 - D) + 1D = 20
33 - 3D + D = 20
-2D = 20 - 33
-2D = -13
D = -13 / (-2)
D = 6.5

So, the cost of a DVD is $6.50.

Substitute the value of D back into Equation 1 to find the cost of a CD:
3C + 1(6.5) = 20
3C + 6.5 = 20
3C = 20 - 6.5
3C = 13.5
C = 13.5 / 3
C = 4.50

Therefore, the cost of a CD is $4.50.

To summarize, the cost of a CD is $4.50 and the cost of a DVD is $6.50.