Answer: A cup of coffee costs $2.50 and a bagel costs $3.50.
Step-by-step explanation: Let's use the following variables to represent the price of each item:
c: price of a cup of coffee (in dollars)
b: price of a bagel (in dollars)
From the problem statement, we know that:
b = c + 1 (a bagel costs $1 more than a cup of coffee)
We also know that you bought 4 cups of coffee and 6 bagels for a total of $31. This can be expressed as:
4c + 6b = 31
Now we can substitute the first equation into the second equation to eliminate b:
4c + 6(c + 1) = 31
Simplifying this equation, we get:
10c + 6 = 31
Subtracting 6 from both sides, we get:
10c = 25
Dividing both sides by 10, we get:
c = 2.5
Now we can use the first equation to find the value of b:
b = c + 1 = 2.5 + 1 = 3.5
Therefore, a cup of coffee costs $2.50 and a bagel costs $3.50.