Question

In: Computer Science

A cookie recepie calls for the following ingridients 1.5 cups of sugar 1 cup of butter...


A cookie recepie calls for the following ingridients
1.5 cups of sugar
1 cup of butter
2.75 cups of flour
The recepie produce48 cookies with these amountof the ingridients. Design a program
that asks the user how many cookie he wants to make, and then displays the numberof cups of eacj iongredient
needed for the specefied number of cookies


// Declare the variables
Declare Real numberOfCookies = 48
Declare Real cupsOfSugar = 1.5
Declare Real cupsOfButter = 1
Declare Real cupsOfFlour = 2.75

Display " Enter the number of cookies "
Input cookies

//Get the amount of sugar you need

set sugar = cookies * cupsOfSugar / numberOfCookies

// Get the amou of butter you need
set butter = cookies * cupsOfButter / numberOfCookies

// Get the amount of flour you need
set flour = cookies * cupsOfFlour / numberOfCookies

Display " To produce -------

please check this pseudocode is ok or not and what i need to write in last line " Display " area

Solutions

Expert Solution

// Declare the variables
Declare Real numberOfCookies = 48
Declare Real cupsOfSugar = 1.5
Declare Real cupsOfButter = 1
Declare Real cupsOfFlour = 2.75

Display "Enter the number of cookies "
Input cookies

//Get the amount of sugar you need
set sugar = cookies * cupsOfSugar / numberOfCookies

// Get the amount of butter you need
set butter = cookies * cupsOfButter / numberOfCookies

// Get the amount of flour you need
set flour = cookies * cupsOfFlour / numberOfCookies

// display the output.
Display "You need " + sugar + " cups Sugar"
Display "You need " + butter + " cups Butter"
Display "You need " + flour + " cups Flour"
**************************************************
Your pseudocode is fine.. 

Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.

Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.


Related Solutions

A female just had a cup of coffee with cream and sugar. You are following the...
A female just had a cup of coffee with cream and sugar. You are following the journey of the glucose molecule from ingestion thru cellular respiration which creates H2O and CO2. You will follow the CO2 molecule until exhalation and the H2O to excretion. List the following pathways. A.            List the physical pathway from the oral cavity to the point of absorption in the gastrointestinal tract. B.            List the physical pathway from the point of absorption of the glucose...
1-1) Arrange three cups filled with water. Put cold water in the first cup together with...
1-1) Arrange three cups filled with water. Put cold water in the first cup together with an ice cube, put hot water (not too hot for your hand) in the second cup and have the third cup at body temperature. Now, put one hand in the cold water and the other hand in the hot water for half a minute or so then put them both in the lukewarm cup. What did you experience? Decide if you think that your...
A recipe calls for 1 1/5 cups of flour for every 1/2 teaspoon of salt. Suppose...
A recipe calls for 1 1/5 cups of flour for every 1/2 teaspoon of salt. Suppose you put 4 cups of flour in a mixing bowl. How much salt should you add?
There are two unmarked cups named M and N. Each cup has 5 mL of a...
There are two unmarked cups named M and N. Each cup has 5 mL of a white powder. One contains baking soda, the other washing soda. There is also 50 mL of a monoprotic acid and water. Determine which substance is baking soda and which is washing soda. How would I determine this?
The sugar content in a one-cup serving of a certain breakfast cereal was measured for a...
The sugar content in a one-cup serving of a certain breakfast cereal was measured for a sample of 140 servings. The average was 11.9 g and the standard deviation was 1.1 g. Find a 95% confidence interval for the mean sugar content. Round the answers to three decimal places. The 95% confidence interval is ( ), ( )
The sugar content in a one-cup serving of a certain breakfast cereal was measured for a...
The sugar content in a one-cup serving of a certain breakfast cereal was measured for a sample of 125 servings. The sample mean sugar content was 11.9g and the sample standard deviation was 1.1g. (a) Find a 99% confidence interval for the mean sugar content. (b) How large a sample is needed so that a 99% confidence interval specifies the mean to within +0.1 (assume the standard deviation is still 1.1g)?
My daily water/fliud intake is usually 6 cups of water, a cup of lemon juice and...
My daily water/fliud intake is usually 6 cups of water, a cup of lemon juice and a small can of soft drink (cola). How does this compare with recommended values? What factors need to be considered in deciding how much water must be consumed?
The average American eats 1.5 cups of vegetables a day (may not be accurate). A researcher...
The average American eats 1.5 cups of vegetables a day (may not be accurate). A researcher is interested in whether teenagers eat less vegetables on average than does the average American. She takes a sample of 25 teenagers and asks how much vegetables they eat. She finds that the mean amount of vegetables her subjects eat a day is 1.1 cups with a standard deviation of 0.5. What would be the appropriate test for the researcher to use to test...
The average American eats 1.5 cups of vegetables a day (may not be accurate). A researcher...
The average American eats 1.5 cups of vegetables a day (may not be accurate). A researcher is interested in whether teenagers eat less vegetables on average than does the average American. She takes a sample of 25 teenagers and asks how much vegetables they eat. She finds that the mean amount of vegetables her subjects eat a day is 1.1 cups with a standard deviation of 0.5. What would be the appropriate test for the researcher to use to test...
How would you separate a cup of coffee with cream and sugar (a mixture) into its...
How would you separate a cup of coffee with cream and sugar (a mixture) into its components using either distillation or paper chromatography? Explain your answer.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT