A cup of coffee cost $4 and a cup of tea cost $3.50. If ray has $40 and has bought 6 cups of coffee, find the maximum cups of tea he can buy
Calculate total coffee spend:
Total coffee spend = Cost per Cup of Coffee * Cups of Coffee
Total coffee spend = 4 * 6
Total coffee spend = 24
Calculate remaining amount to be spent on tea:
Remaining tea money = Starting Money - Total Coffee spend
Remaining tea money = 40 - 24
Remaining tea money = 16
Calculate cups of tea Ray can buy:
Cups of tea Ray can buy = Remaining Tea money / Cost per cup of tea
Cups of tea Ray can buy = 16/3.50
Cups of tea Ray can buy = 4.57142857143
Since Ray can't buy partial cups, we round down and we get:
Cups of tea Ray can buy = 4
Calculate total coffee spend:
Total coffee spend = Cost per Cup of Coffee * Cups of Coffee
Total coffee spend = 4 * 6
Total coffee spend = 24
Calculate remaining amount to be spent on tea:
Remaining tea money = Starting Money - Total Coffee spend
Remaining tea money = 40 - 24
Remaining tea money = 16
Calculate cups of tea Ray can buy:
Cups of tea Ray can buy = Remaining Tea money / Cost per cup of tea
Cups of tea Ray can buy = 16/3.50
Cups of tea Ray can buy = 4.57142857143
Since Ray can't buy partial cups, we round down and we get:
Cups of tea Ray can buy = 4