The cake cost $9 in total because 4 + 2 + .5 + 2.5 = <<4+2+.5+2.5=9>>9
Each slice costs $1.5 because 9 / 6 = <<9/6=1.5>>1.5
The dog ate 4 slices because 6 - 2 = <<6-2=4>>4
The amount the dog ate cost $6 because 4 x 1.5 = <<4*1.5=6>>6
#### 6