SAT.java


Below is the syntax highlighted version of SAT.java from §2.1 Static Methods.


/******************************************************************************
 *  Compilation:  javac SAT.java
 *  Execution:    java SAT
 *  Dependencies: Gaussian.java StdOut.java
 *
 *  Computes the fraction of students that score less than 820 on their
 *  SAT exam, given that the average score is 1019 and the standard deviation
 *  is 209.
 *
 *  Answer = roughly 17%.
 *
 *  % java SAT
 *  0.17050967431793962
 *
 ******************************************************************************/


public class SAT {

    public static void main(String[] args) {
        double mu    = 1019;
        double sigma =  209;
        double z     =  820;
        StdOut.println(Gaussian.Phi(z, mu, sigma));
        StdOut.println(Gaussian.Phi(1437, mu, sigma));
    }
}


Copyright © 2000–2022, Robert Sedgewick and Kevin Wayne.
Last updated: Thu Aug 11 10:15:13 EDT 2022.