Advertisement
476179

NestedStatmentsAct1

Oct 24th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. package activities;
  2. import java.util.Scanner;
  3. public class NestedStatmentsAct
  4. {
  5.  
  6. public static void main(String[] args)
  7. { Scanner keyboard = new Scanner(System.in);
  8. double amt1, amt2;
  9. System.out.print("enter amt1: ");
  10. amt1 = keyboard.nextDouble();
  11. System.out.print("enter amt2: ");
  12. amt2 = keyboard.nextDouble();
  13.  
  14. if (amt1>10)
  15. {
  16. if (amt2 < 100)
  17. {
  18. if (amt1 >amt2)
  19. {
  20. System.out.println(amt1);
  21. }
  22. else
  23. {
  24. System.out.println(amt2);
  25. }
  26. }
  27. else
  28. {
  29. System.out.println("amt2 is greater than 100");
  30. }
  31. }
  32. else
  33. {
  34. System.out.println("amt1 is not greater than 10");
  35. }
  36. keyboard.close();
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement