HW4 - CSE2221 - Wooseung Chang Homework#4 CSE2221 03:00PM 1...

This preview shows page 1 out of 1 page.

Wooseung Chang Homework #4 CSE2221 03:00PM 1) private static boolean pointIsInCircle(double xCoord, yCoord) { return((xCoord – 1) * (xCoord – 1) + (yCoord – 1) * (yCoord – 1) <= 1.0); } 2) private static int numberOfPointIsInCircl(int n) { Random rnd = new Random1L(); int numberOfPoints = 0; int pointIsInCircle = 0; while(numberOfPoints < n) { double xCoord = rnd.nextDouble() * 2; double yCoord = rnd.nextDouble() * 2; numberOfPoints++;

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture