Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Assign2;
- import java.util.Scanner;
- public class Recipe {
- private double butter; // butter, sugar, molasses, ginger
- private double egg;
- private double flour;
- private double cinnamon; // baking soda, cinnamon
- private String Pinches;
- private String Teaspoons;
- private String Tablespoons;
- private String Cups;
- public Recipe() {
- butter= 1;
- egg = 2;
- flour =0.33;
- cinnamon = 0.25;
- }
- public int getNumberOfCookies(){
- Scanner input=new Scanner(System.in);
- System.out.print("How many cookies would you like to make? ");
- int number=input.nextInt();
- return number;
- }
- public void calculateRecipe(int number){
- butter=1*number;
- cinnamon=1*number;
- egg=2*number;
- flour=1.0/3*number;
- }
- public void displayRecipe(){
- System.out.println();
- System.out.println("1) Mix " + butter + " tablespoons of butter with " + butter + " tablespoons of brown sugar.");
- System.out.println("2) Add " + cinnamon + " tablespoons of molasses and " + cinnamon + " teaspoons of egg and mix well.");
- System.out.println("3) Add " + flour + " cups of flour and " + flour + " teaspoons baking soda (don't mix yet!)");
- System.out.println("4) Add " + egg + " teaspoons of cinnamon and " + egg + " pinches of ginger and mix well");
- System.out.println("5) Put a little flour on the table and flatten out your dough. Cut out your gingerbread men with a cookie cutter");
- System.out.println("6) Place your Gingerbread men on an ungreased cookie sheet. Bake at 350 degrees for 8-10 minutes");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement