Let us assume number of bags of cotton candies and chocolate bars = x.
Cost of each a bag of cotton candy = $0.70.
Cost of each chocolate bar = $ 0.50.
Total cost of x bags of cotton candies = 0.70 x.
Total cost of x chocolate bars = 0.50x.
Total cost of all items = $6.30.
0.70 x +0.50x = 6.30.
1.20x = 6.30.
Dividing both sides by 1.20, we get
1.20x/1.20 = 6.30/1.20
x = 5.25.
Total number of bags of cotton candies + number of chocolate bars = 5.25 + 5.25 = 10.50 ≈ 11 approximately.