Guest User

Untitled

a guest
Oct 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. //Type your name here
  2.  
  3. package YOURPROJECTNAME;
  4. import java.util.Scanner;
  5.  
  6. public class YOURPROJECTNAME {
  7. public static void main(String[] args) {
  8. double number1, number2;
  9. int choice;
  10. Scanner input = new Scanner(System.in);
  11.  
  12. System.out.print("Enter the first number: ");
  13. number1 = input.nextDouble();
  14. System.out.print("Enter the second number: ");
  15. number2 = input.nextDouble();
  16.  
  17. //Insert code here
  18.  
  19. if(choice == 1)
  20. System.out.println(number1+number2);
  21. else if(choice == 2)
  22. System.out.println(number1-number2);
  23. //continue this code for multiplication and division
  24. }
  25.  
  26. }
  27.  
  28. /* Sample output
  29.  
  30. Enter the first number: 35.5
  31. Enter the second number: 12.6
  32.  
  33. What would you like to do?
  34. 1. Addition
  35. 2. Subtraction
  36. 3. Multiplication
  37. 4. Division
  38. Choice: 4
  39. 48.1
  40.  
  41. */
Add Comment
Please, Sign In to add comment