Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class AsymptoteFinder {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- System.out.print("What is Integer M? ");
- int integerM = keyboard.nextInt();
- System.out.print("What is Integer N? ");
- int integerN = keyboard.nextInt();
- if (integerM == integerN) {
- System.out.println("The asymptote is horizontal.");
- } else if (integerN > integerM) {
- System.out.println("THe asymptote is the x axis.");
- } else {
- int n = (integerM - integerN);
- switch (n) {
- case 1:
- System.out.println("The asymptote is linear.");
- break;
- case 2:
- System.out.println("The asymptote is quadratic.");
- break;
- case 3:
- System.out.println("The asymptote is cubic.");
- break;
- case 4:
- System.out.println("The asymptote is quartic.");
- break;
- case 5:
- System.out.println("The asymptote is quintic.");
- break;
- case 6:
- System.out.println("The asymptote is sextic.");
- break;
- case 7:
- System.out.println("The asymptote is septic.");
- break;
- case 8:
- System.out.println("The asymptote is octic.");
- break;
- case 9:
- System.out.println("The asymptote is nonic.");
- break;
- case 10:
- System.out.println("The asymptote is decic.");
- break;
- default:
- System.out.println("Difference between Integer M and Integer N cannot be greater than 10");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement