Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Task02
  5. {
  6. public static void main(String[] args)
  7. {
  8. int value1;
  9. int value2;
  10.  
  11. Scanner input= new Scanner(System.in);
  12. System.out.println("Please enter 1st integer: ");
  13. value1 = input.nextInt();
  14.  
  15. System.out.println("Please enter 2nd integer: ");
  16. value2 = input.nextInt();
  17. }
  18.  
  19. public static void doCalculation(int val1, int val2)
  20. {
  21. //
  22. int c = val1 + val2;
  23. System.out.println("The result of " + val1 + "+" + val2 + "is" + c);
  24. int d = val1 - val2;
  25. System.out.println("The result of " + val1 + "-" + val2 + "is" + d);
  26. int e = val1 * val2;
  27. System.out.println("The result of " + val1 + "*" + val2 + "is" + e);
  28. int f = val1 / val2;
  29. System.out.println("The result of " + val1 + "/" + val2 + "is" + f);
  30. //
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement