Advertisement
Guest User

Java Help

a guest
Nov 17th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Calculator {
  3. public static void main(String args[]) {
  4. Scanner input=new Scanner(System.in);
  5. System.out.println("Welcome to My Multi Calculator");
  6. System.out.println("Here are the choices:");
  7. System.out.println("(1) Convert Pounds to Kilograms");
  8. System.out.println("(2) Convert USD to Euro");
  9. System.out.println("(3) Convert Degrees F to C");
  10. System.out.println("(4) Calculate 20% gratuity on a bill");
  11. System.out.println("(5) Calculate if a number is prime");
  12. System.out.println("(6) Calulate the absolute difference of two numbers");
  13. System.out.println("(7) Quit");
  14.  
  15. if (input.equals("1")) {
  16. //System.out.println("1");
  17. System.out.println("Input amount:");
  18. double size = input.nextInt();
  19. System.out.println("Answer: "+ size*0.453592);
  20. }
  21. if (input.equals("2")) {
  22. System.out.println("2");
  23. }
  24. if (input.equals("3")) {
  25. System.out.println("3");
  26. }
  27. if (input.equals("4")) {
  28. System.out.println("4");
  29. }
  30. if (input.equals("5")) {
  31. System.out.println("5");
  32. }
  33. if (input.equals("6")) {
  34. System.out.println("6");
  35. }
  36. if (input.equals("7")) {
  37. System.out.println("7");
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement