We have a restriction on the sugar content on the drinks: it can not have more than 25 g of sugar.
We have to find the largest size of the cola drink, given that 12 oz of the cola drink have 40g of sugar.
The ratio of sugar content of the Cola drink is 12 oz : 40 g.
We can find the largest volume of the drink by calculating the volume that correspond to an amount of 25 grams of sugar (also rule of three can be used):

The largest cola drink can be 7.5 oz.