Please show me how to make attributes for the following scenario:

On the main product page, I normally have one product image and description, but now I have one product image with different sizes and prices. For instance:

Product A has three sizes: A1: Size: 14" Price: $50
A2: Size: 13" Price: $40
A3: Size: 12" Price: $30

I want my customers who come to the main product page can choose the size that they want. I can make the attributes for both "Size" and "Price", but I cannot make them work together. For example, when the customer chooses the size, the price doesn't change.

Thanks so much for your big help.