This is a volume question. 8x8x8, 512 cubic inches of water.
The cost of the visit to the dentist can be expressed as the cost equals 100x+50.
The initial cost of the appointment would be $50; no matter how many cavities one has, they would still have to pay $50.
The cost of each cavity is represented as 100x, because each cavity costs $100. x represents the number of cavities, as we do not know how many cavities there are.