CSE2221-HW4.docx - Shayla Vo CSE 2221 u2013 HW 4 1 private...

This preview shows page 1 out of 1 page.

Shayla Vo CSE 2221 – HW 4 Sept 1, 2019 1. private static boolean pointIsInCircle( double xCoord , double yCoord ) { if (( xCoord - 1.0 )* ( xCoord - 1.0) + ( yCoord - 1.0) * ( yCoord - 1.0) < 1.0 ) { return true ; } else { return false ; } } 2. private static int numberOfPointsInCircle( int n ) { int j = 0; Random rnd = new Random1L (); for ( int i = 0; i < n ; i ++) { double xCoord = rnd .nextouble() * 2.0; double yCoord = rnd .nextouble() * 2.0; if ( pointIsInCircle (

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture