Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class main {
  4. public static void sub1(String[] args) {
  5. Scanner input = new Scanner(System.in);
  6. int n1, n2;
  7. int ans;
  8. String op;
  9.  
  10. System.out.println("What is the first number?");
  11. n1 = input.nextInt();
  12. input.nextLine();
  13. System.out.println("What is the second number?");
  14. n2 = input.nextInt();
  15. input.nextLine();
  16. System.out.println("What is the operation?");
  17. op = input.nextLine();
  18. switch (op){
  19. case 1:
  20. System.out.println(add(n1, n2));
  21. break;
  22.  
  23.  
  24. }
  25.  
  26.  
  27.  
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement