To solve this, we must first find out the cost-per-ounce of a cup of coffee. Assuming that the rates are flat, then we can just divide the 8-dollar-cost by the 4-ounce cup that it buys.
8 / 4 = 2
The cost-per-ounce of a cup of coffee is $2.
Now, we just have to multiply the cost-per-ounce by the amount of coffee we want to find out the cost of.
2 * 3 = 6
With all else constant, a 3-ounce cup of coffee would cost $6.
Hope that helped! =)