void page3() { String t = "Step 3 - The Test Statistics"; textFont(myboldfont, 18); text(t, 30, 170); textFont(myfont, 18); testl = (aStudy.y - aStudy.n * aStudy.p + 0.5)/sqrt(aStudy.n * aStudy.p * (1-aStudy.p)); testu = (aStudy.y - aStudy.n * aStudy.p - 0.5)/sqrt(aStudy.n * aStudy.p * (1-aStudy.p)); if (aStudy.k==0) { t = "Since the alternative is left-tailed, we calculate: "; text(t, 30, 200); image(zl, 70, 220); t = "Z_l = "; text(t, 130, 345); tf2.setXY(200,330); tf3.setVisible(false); } else if (aStudy.k==1) { t = "Since the alternative is right-tailed, we calculate: "; text(t, 30, 200); image(zu, 70, 220); t = "Z_u = "; text(t, 130, 345); tf2.setXY(200,330); tf3.setVisible(false); } else { t = "Since the alternative is two-tailed, we calculate: "; text(t, 30, 200); image(zl, 70, 220); image(zu, 300, 220); t = "Z_l = "; text(t, 130, 345); t = "Z_u = "; text(t, 400, 345); tf2.setXY(200,330); tf3.setVisible(true); } t = "Plug in: Y = " + aStudy.y + ", n = " + aStudy.n + ", and p zero = " + nf(aStudy.p, 1, 2) + ". Calculate the value of Z with at least 3 decimal places. Type in the following textbox(s) then click Answer:"; drawStrings(t, 30, 290, 25); fill(0, 0, 255); drawStrings(feedback, 80, 380,25); }