CSE 2221 HW 3.docx - 1 Implement(i.e provide the code for...

This preview shows page 1 - 2 out of 3 pages.

1. Implement (i.e., provide the code for the body of) the static method declared as follows: 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 /** * Checks whether the given point (xCoord, yCoord) is inside the circle of * radius 1.0 centered at the point (1.0, 1.0). * * @param xCoord * the x coordinate of the point * @param yCoord * the y coordinate of the point * @return true if the point is inside the circle, false otherwise */ private static boolean pointIsInCircle(double xCoord, double yCoord) { ... } /** * Checks whether the given point (xCoord, yCoord) is inside the circle of * radius 1.0 centered at the point (1.0, 1.0). * * @param xCoord * the x coordinate of the point * @param yCoord * the y coordinate of the point * @return true if the point is inside the circle, false otherwise */ private static boolean pointIsInCircle(double xCoord, double yCoord) { boolean pointIsInCircle = true; if(xCoord*xCoord + yCoord*yCoord <= 1){ return pointIsInCircle; } else{ pointIsInCircle = false; return pointIsInCircle; } }

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture