Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class AsymptoteFinder {
  4. public static void main(String[] args) {
  5. Scanner keyboard = new Scanner(System.in);
  6.  
  7. System.out.print("What is Integer M? ");
  8. int integerM = keyboard.nextInt();
  9. System.out.print("What is Integer N? ");
  10. int integerN = keyboard.nextInt();
  11.  
  12. if (integerM == integerN) {
  13. System.out.println("The asymptote is horizontal.");
  14. } else if (integerN > integerM) {
  15. System.out.println("THe asymptote is the x axis.");
  16. } else {
  17. int n = (integerM - integerN);
  18. switch (n) {
  19. case 1:
  20. System.out.println("The asymptote is linear.");
  21. break;
  22. case 2:
  23. System.out.println("The asymptote is quadratic.");
  24. break;
  25. case 3:
  26. System.out.println("The asymptote is cubic.");
  27. break;
  28. case 4:
  29. System.out.println("The asymptote is quartic.");
  30. break;
  31. case 5:
  32. System.out.println("The asymptote is quintic.");
  33. break;
  34. case 6:
  35. System.out.println("The asymptote is sextic.");
  36. break;
  37. case 7:
  38. System.out.println("The asymptote is septic.");
  39. break;
  40. case 8:
  41. System.out.println("The asymptote is octic.");
  42. break;
  43. case 9:
  44. System.out.println("The asymptote is nonic.");
  45. break;
  46. case 10:
  47. System.out.println("The asymptote is decic.");
  48. break;
  49. default:
  50. System.out.println("Difference between Integer M and Integer N cannot be greater than 10");
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement