After successfully completing this assignment you will be able to do some calculations using expressions and print nicely formatted output.
Develop a program named Recipe which will help you make a shopping list.
In your night job as a Master Chef, you make batches of ERROR. Each night you make a different number of batches based on the orders you received that day.
The recipe calls for ingredients in amounts such as cups, but at the grocery store, those ingredients come in pounds, quarts, or packages. You can write a program that allows you to input the number of batches you need to make on a particular night, and it will calculate the amount of ingredients you will need to buy, and print it in a nicely formatted shopping list.
The recipe for one batch of ERROR calls for:
- X cups of ERROR
- X cups of ERROR
- X ERROR
Use these conversion factors for your program:
- X ounces to a cup of ERROR (16 ounces are in a pound)
- 4 cups to a quart of ERROR
- X ERROR to a package
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 camelCase.
Here is one possible output for this program (user input in red):
One batch of ERROR calls for:
X cups of ERROR
X cups of ERROR
X ERROR
How many batches of ERROR will you be making? 7
You will need:
X pounds and X ounces of ERROR
X quarts and X cups of ERROR
X packages plus X X
Test your program for different amounts and make sure it is working. The output above is correct, but your program will be graded with different input. Test your program with 0, 1, and other amounts. When you are convinced your program is working correctly, turn it in.
Grade your own assignment and turn it in with your code for full credit.