Let the cost of the soft drink = C then the price of the sandwich was 3.5 times as much = 3.5C
And
C + 3.5C = Total Cost
C + 3.5C = 9
4.5C = 9 divide both sides by 4.5
C = 9/4.5 = $2.00 for the soft drink
And 3.5C = 3.5(2.00) = $7.00 cost of the sandwich