ITEC 120
HW2: Cookies (75 points)

Academic Integrity

Be reminded that this homework assignment must be your own work.

Objectives

After successfully completing this assingment you will be able to do some simple calculations using expressions and print nicely formatted output.

Assignment

Develop a program named Cooky which will help Chef Baker make a shopping list.

Chef Baker makes many batches of cookies, depending on who he is baking for. The cooky recipe calls for cups of flour and sugar and butter, but at the grocery store, those ingredients come in pounds. Your program will allow Chef Baker to input the number of batches of cookies he plans to make, and will calculate the amount of ingredients he will need and print it in a nicely formatted shopping list.

One recipe for a batch of cookies calls for:

Use these conversion factors for your program:

For full credit, you will need to use good variable names, several well named constants, good indentation style, as well as proper code style, such as names of constants in all caps, and variable names in camel case.

Here is one possible output for this program (user input in red):

One batch of cookies calls for: 
	3 cups of flour
	2 cups of sugar
	1 cups of butter
	2 eggs

How many batches of cookies will you be making? 7

You will need:

6 pounds and 9 ounces of flour
6 pounds and 2 ounces of sugar
3 pounds and 2 sticks of butter
1 dozen plus 2 eggs

Here is another:

One batch of cookies calls for: 
	3 cups of flour
	2 cups of sugar
	1 cups of butter
	2 eggs

How many batches of cookies will you be making? 2

You will need:

1 pounds and 14 ounces of flour
1 pounds and 12 ounces of sugar
1 pounds and 0 sticks of butter
0 dozen plus 4 eggs 

Notice there may be a zero in the output, such as 0 sticks of butter and 0 dozen as in the example above. It would be nice style to supress the printing if an amount is zero - for example, print 4 eggs instead of 0 dozen plus 4 eggs. Later in the semester we will learn how to do such a thing. For now, printing the zeros will earn full credit.

Test your program for different amounts and make sure it is working. The two outputs above are correct, but also test your program with 0, 1, and other amounts. When you are convinced your program is working correctly, turn it in.

Submit Your Assignment

Submit your Cooky.java to the HW2 dropbox on D2L.