To set a linear equation we have to identify the variables:
Let x be the number of bananas, y the number of mangoes, and z the number of apples.
Second, we find which constant multiplies which variable, in this case, the constants are the prices of each fruit:
x*1, y*3, and z*2.
Finally, we set the sum of the variables times the constants to another constant.
Answer: Option D.