The Utility Maximization rule states that as long as one good provides more utility per dollar than another, the consumer will buy more of that good.Marginal utility is the extra utility a consumer obtains from the consumption of one additional unit of a good or service. So, in our case the additional unit can be cherry or date. MUc is the marginal utility of cherry and MUd is the marginal utility of date:
MUc=2*MUd
The price of the cherries is Pc and of the dates Pd: Pc=2*Pd.
According the utility maximization: MUc/Pc=MUd/Pd
2*MUd/2*Pd=MUd/Pd
So, yes the consumer is maximizing utility.