Advertisement
Guest User

cooking with code

a guest
Sep 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package homework;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class cooking {
  6.    
  7.     public static void main(String[] args) {
  8.         Scanner input = new Scanner(System.in);
  9.         Double sugar = 1.5/48;
  10.         Double butter = 1.0/48;
  11.         Double flour = 2.75/48;
  12.         System.out.println("How many Cookies?: ");
  13.         int cookies = input.nextInt();
  14.        
  15.         System.out.println("You will need: \n" + (sugar*cookies) +" cup of sugar \n " + (butter*cookies) + "\b cup of butter \n " + (flour*cookies) + "\b cup of flour");          
  16.  
  17.        
  18.        
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement