# How to solve simple programming problem with strange math question?

Here is the question:

A cookie recipe calls for the following ingredients:

• 1.5 cups of sugar
• 1 cup of butter
• 2.75 cups of flour

The recipe produces 48 cookies with this amount of the ingredients. Write a program that asks the user how many cookies he or she wants to make, and then displays the number of cups of each ingredient needed for the specified number of cookies.

I already saw the answer, and it only confused me more. I need someone to explain to me how we go about figuring out how many cups of sugar is needed if, for example, the user wants to bake 50 cookies.

EDIT: I'm mainly interested in the thought process used to solve the math portion of this problem.

• How much of each ingredient do you need for one cookie? – Ben Longo Jan 9 '16 at 8:40
• @BenLongo 0.0375 cups of sugar ... Then multiply this by the number of cookies the user needs ..... wow, I feel stupid. I looked at this problem with all 3 ingredients combined together, confusing the heck out of me. Thanks :) – code_flow Jan 9 '16 at 8:45