Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. /*
  2. * Tyler Beach
  3. */
  4. import java.util.*;
  5. public class test {
  6.  
  7. public static void main(String[] args) {
  8. Coffee coffee_1 = new Coffee();
  9. Coffee coffee_2 = new Coffee();
  10. String name ;
  11. int caff_cont;
  12. Scanner keyboard = new Scanner(System.in);
  13. System.out.println("Let’s Coffee!!!1!11!!ONE!!!1!");
  14. System.out.println("What’s the name of the first coffee? ");
  15. name = keyboard.nextLine();
  16. System.out.println("What’s the caffeine content");
  17. caff_cont = keyboard.nextInt();
  18. keyboard.nextLine(); //get rid of newline
  19. coffee_1.setName(name);
  20. coffee_1.setCaffeine(caff_cont);
  21. System.out.println("What’s the name of the second coffee? ");
  22. name = keyboard.nextLine();
  23. System.out.println("What’s the caffeine content");
  24. caff_cont = keyboard.nextInt();
  25. coffee_2.setName(name);
  26. coffee_2.setCaffeine(caff_cont);
  27. System.out.printf("It would take " + coffee_1.getDangerAmount() + " " + coffee_1.getName() + " coffees before it’s dangerous to drink more.\n");
  28. System.out.printf("It would take " + coffee_2.getDangerAmount() + " " + coffee_2.getName() + " coffees before it’s dangerous to drink more.\n");
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement