Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Quadrant Project
- *
- * Zain Arfi
- * @version (a version number or a date)
- */
- import java.util.*;
- public class Quadrant
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- System.out.println("What is x?");
- double coor1 = console.nextDouble();
- System.out.println("What is y?");
- double coor2 = console.nextDouble();
- double quad = Calculate( coor1 , coor2 );
- System.out.println(quad);
- }
- public static double Calculate(double x, double y)
- {
- if( x > 0 && y > 0)
- {
- return 1;
- }
- if ( x < 0 && y > 0)
- {
- return 2;
- }
- if ( x < 0 && y < 0)
- {
- return 3;
- }
- else
- {
- return 4;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement