Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. package Assign2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Recipe {
  6. private double butter; // butter, sugar, molasses, ginger
  7. private double egg;
  8. private double flour;
  9. private double cinnamon; // baking soda, cinnamon
  10. private String Pinches;
  11. private String Teaspoons;
  12. private String Tablespoons;
  13. private String Cups;
  14.  
  15.  
  16. public Recipe() {
  17. butter= 1;
  18. egg = 2;
  19. flour =0.33;
  20. cinnamon = 0.25;
  21. }
  22.  
  23. public int getNumberOfCookies(){
  24. Scanner input=new Scanner(System.in);
  25. System.out.print("How many cookies would you like to make? ");
  26. int number=input.nextInt();
  27. return number;
  28.  
  29.  
  30. }
  31.  
  32. public void calculateRecipe(int number){
  33. butter=1*number;
  34. cinnamon=1*number;
  35. egg=2*number;
  36. flour=1.0/3*number;
  37.  
  38.  
  39. }
  40. public void displayRecipe(){
  41. System.out.println();
  42. System.out.println("1) Mix " + butter + " tablespoons of butter with " + butter + " tablespoons of brown sugar.");
  43. System.out.println("2) Add " + cinnamon + " tablespoons of molasses and " + cinnamon + " teaspoons of egg and mix well.");
  44. System.out.println("3) Add " + flour + " cups of flour and " + flour + " teaspoons baking soda (don't mix yet!)");
  45. System.out.println("4) Add " + egg + " teaspoons of cinnamon and " + egg + " pinches of ginger and mix well");
  46. 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");
  47. System.out.println("6) Place your Gingerbread men on an ungreased cookie sheet. Bake at 350 degrees for 8-10 minutes");
  48.  
  49. }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement