/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; public class Applet1 extends Applet { int Test_Type1 = 0; int Test_Type2 = 0; int Test_Type3 = 0; int Test_Type4 = 0; int Test_Type5 = 0; int Test_Type6 = 0; int Test_Type7 = 0; int Test_Type8 = 0; int Test_Type9 = 0; int Test_Type10 = 0; int Test_Type11 = 0; int Test_Type12 = 0; int Block = 1; int BonusNumber = 0; int ResearchNumber = 0; int Question_Number = 0; int Successful_Test = 1000; int Extra = 500; int Test_Number = 1; int Test_Cost = 100; int test_money = 500; boolean NextTEST = true; String Tested_Animal = null; String Animal_Report = null; String Results = null; String Test_Money = null; String Mammal = "mammals "; String Birds = "birds "; String Fish = "fish "; String Reptiles = "reptiles "; String Animal_Type1 = null; String Animal_Type2 = null; String Animal_Type3 = null; String Animal_Type4 = null; String Animal_Type5 = null; String Animal_Type6 = null; String Animal_Type7 = null; String Animal_Type8 = null; String Animal_Type9 = null; String Animal_Type10 = null; String Animal_Type11 = null; String Animal_Type12 = null; String Button_Label = null; String Start = "Given that all "; String First = null; String Second = null; String Third = null; String Forth = null; String Fifth = null; String have ="have "; String Trait =null; String End = ", which animal(s) would you test to see if only "; //Question = Start + Animal_Type + have + Trait + End + Animal_Type + have + Trait; String Question1 = null; String Question2 = null; String Question3 = null; String Question4 = null; String Question5 = null; String Question6 = null; String Question7 = null; String Question8 = null; String Question9 = null; String Question10 = null; String Question11 = null; String Question12 = null; String EndExp= "You are done with the experiment. Thank you."; public void init() { //{{INIT_CONTROLS setLayout(null); //setSize(800,600); Group1 = new CheckboxGroup(); M1 = new java.awt.Checkbox(null, Group1, false); M1.setBounds(44,204,100,14); M1.setVisible(false); add(M1); M2 = new java.awt.Checkbox(null, Group1, false); M2.setBounds(44,228,100,14); M2.setVisible(false); add(M2); M3 = new java.awt.Checkbox(null, Group1, false); M3.setBounds(44,252,100,14); M3.setVisible(false); add(M3); M4 = new java.awt.Checkbox("M4", Group1, false); M4.setBounds(44,276,100,14); M4.setVisible(false); add(M4); M5 = new java.awt.Checkbox("M5", Group1, false); M5.setBounds(44,300,100,14); M5.setVisible(false); add(M5); R1 = new java.awt.Checkbox("R1", Group1, false); R1.setBounds(158,204,96,14); R1.setVisible(false); add(R1); R2 = new java.awt.Checkbox("R2", Group1, false); R2.setBounds(158,228,96,14); R2.setVisible(false); add(R2); R3 = new java.awt.Checkbox("R3", Group1, false); R3.setBounds(158,252,96,14); R3.setVisible(false); add(R3); R4 = new java.awt.Checkbox("R4", Group1, false); R4.setBounds(158,276,96,14); R4.setVisible(false); add(R4); R5 = new java.awt.Checkbox("R5", Group1, false); R5.setBounds(158,300,96,14); R5.setVisible(false); add(R5); F1 = new java.awt.Checkbox("F1", Group1, false); F1.setBounds(254,204,96,14); F1.setVisible(false); add(F1); F2 = new java.awt.Checkbox("F2", Group1, false); F2.setBounds(254,228,96,14); F2.setVisible(false); add(F2); F3 = new java.awt.Checkbox("F3", Group1, false); F3.setBounds(254,252,96,14); F3.setVisible(false); add(F3); F4 = new java.awt.Checkbox("F4", Group1, false); F4.setBounds(254,276,96,14); F4.setVisible(false); add(F4); F5 = new java.awt.Checkbox("F5", Group1, false); F5.setBounds(254,300,96,14); F5.setVisible(false); add(F5); B1 = new java.awt.Checkbox("B1", Group1, false); B1.setBounds(350,204,96,14); B1.setVisible(false); add(B1); B2 = new java.awt.Checkbox("B2", Group1, false); B2.setBounds(350,228,96,14); B2.setVisible(false); add(B2); B3 = new java.awt.Checkbox("B3", Group1, false); B3.setBounds(350,252,96,14); B3.setVisible(false); add(B3); B4 = new java.awt.Checkbox("B4", Group1, false); B4.setBounds(350,276,96,14); B4.setVisible(false); add(B4); B5 = new java.awt.Checkbox("B5", Group1, false); B5.setBounds(350,300,96,14); B5.setVisible(false); add(B5); Blank = new java.awt.Checkbox("B5", Group1, false); Blank.setBounds(350,324,96,12); Blank.setState(true); Blank.setVisible(false); add(Blank); Question = new java.awt.TextArea("",0,0,TextArea.SCROLLBARS_NONE); Question.setEditable(false); Question.setText(Question1); Question.setBounds(25,24,500,75); Question.setVisible(false); add(Question); Bonus = new java.awt.TextArea("",0,0,TextArea.SCROLLBARS_NONE); Bonus.setBounds(564,36,123,41); Bonus.setVisible(false); add(Bonus); Research_Funds = new java.awt.TextArea("",0,0,TextArea.SCROLLBARS_NONE); Research_Funds.setBounds(564,108,123,41); Research_Funds.setVisible(false); add(Research_Funds); Test_Results = new java.awt.TextArea("",0,0,TextArea.SCROLLBARS_NONE); Test_Results.setEditable(false); Test_Results.setBounds(48,420,336,135); Test_Results.setVisible(false); add(Test_Results); Decision_Yes = new java.awt.Button(); Decision_Yes.setLabel("Yes"); Decision_Yes.setBounds(520,264,92,29); Decision_Yes.setBackground(new Color(12632256)); Decision_Yes.setVisible(false); add(Decision_Yes); Decision_No = new java.awt.Button(); Decision_No.setLabel("No"); Decision_No.setBounds(620,264,92,29); Decision_No.setBackground(new Color(12632256)); Decision_No.setVisible(false); add(Decision_No); Decision_Question = new java.awt.TextArea("Blank",0,0,TextArea.SCROLLBARS_NONE); Decision_Question.setEditable(false); Decision_Question.setVisible(false); Decision_Question.setBounds(504,300,231,65); add(Decision_Question); Response_Yes = new java.awt.Button(); Response_Yes.setLabel("Yes"); Response_Yes.setBounds(504,372,72,29); Response_Yes.setBackground(new Color(12632256)); Response_Yes.setVisible(false); add(Response_Yes); Response_No = new java.awt.Button(); Response_No.setLabel("No"); Response_No.setBounds(588,372,72,29); Response_No.setBackground(new Color(12632256)); Response_No.setVisible(false); add(Response_No); Response_Cancel = new java.awt.Button(); Response_Cancel.setLabel("Cancel"); Response_Cancel.setBounds(672,372,72,29); Response_Cancel.setBackground(new Color(12632256)); Response_Cancel.setVisible(false); add(Response_Cancel); Next_Test = new java.awt.Button(); Next_Test.setLabel("Next Question"); Next_Test.setBounds(575,537,100,29); Next_Test.setBackground(new Color(12632256)); Next_Test.setVisible(false); add(Next_Test); Feedback = new java.awt.TextArea("",0,0,TextArea.SCROLLBARS_NONE); Feedback.setEditable(false); Feedback.setBounds(504,468,240,60); Feedback.setVisible(false); add(Feedback); label1 = new java.awt.Label("Test Results"); label1.setBounds(120,396,84,20); label1.setVisible(false); add(label1); label2 = new java.awt.Label("Bonus"); label2.setBounds(564,12,120,20); label2.setVisible(false); add(label2); label3 = new java.awt.Label("Research Funds"); label3.setBounds(564,84,120,20); label3.setVisible(false); add(label3); label4 = new java.awt.Label("Are you ready to make a decision?"); label4.setVisible(false); label4.setBounds(504,240,228,20); add(label4); label5 = new java.awt.Label("Mammals"); label5.setBounds(48,180,60,20); label5.setVisible(false); add(label5); label6 = new java.awt.Label("Reptiles"); label6.setVisible(false); label6.setBounds(144,180,60,20); add(label6); label7 = new java.awt.Label("Fish"); label7.setVisible(false); label7.setBounds(240,180,48,20); add(label7); label8 = new java.awt.Label("Birds"); label8.setVisible(false); label8.setBounds(336,180,60,20); add(label8); label9 = new java.awt.Label("Conclusions"); label9.setVisible(false); label9.setBounds(504,444,240,19); add(label9); label10 = new java.awt.Label("Select animal to test"); label10.setVisible(false); label10.setBounds(115,150,300,19); add(label10); label11 = new java.awt.Label("Money left for testing"); label11.setVisible(false); label11.setBounds(504,444,240,19); add(label11); Money = new java.awt.TextArea("",0,0,TextArea.SCROLLBARS_NONE); Money.setBounds(504,468,123,41); Money.setVisible(false); add(Money); Start_Exp = new java.awt.Button(); Start_Exp.setLabel("Test Animal"); Start_Exp.setBounds(48,24,336,143); Start_Exp.setBackground(new Color(12632256)); add(Start_Exp); Test_Animal = new java.awt.Button(); Test_Animal.setLabel("Test Animal"); Test_Animal.setBounds(144,348,132,35); Test_Animal.setVisible(false); Test_Animal.setBackground(new Color(12632256)); add(Test_Animal); //}} //{{REGISTER_LISTENERS SymMouse aSymMouse = new SymMouse(); Response_Yes.addMouseListener(aSymMouse); Response_No.addMouseListener(aSymMouse); Response_Cancel.addMouseListener(aSymMouse); Decision_Yes.addMouseListener(aSymMouse); Decision_No.addMouseListener(aSymMouse); Test_Animal.addMouseListener(aSymMouse); Next_Test.addMouseListener(aSymMouse); Start_Exp.addMouseListener(aSymMouse); SymItem lSymItem = new SymItem(); R4.addItemListener(lSymItem); M2.addItemListener(lSymItem); M3.addItemListener(lSymItem); M4.addItemListener(lSymItem); M5.addItemListener(lSymItem); R1.addItemListener(lSymItem); R2.addItemListener(lSymItem); R3.addItemListener(lSymItem); M1.addItemListener(lSymItem); R5.addItemListener(lSymItem); F1.addItemListener(lSymItem); F2.addItemListener(lSymItem); F3.addItemListener(lSymItem); F4.addItemListener(lSymItem); F5.addItemListener(lSymItem); B1.addItemListener(lSymItem); B2.addItemListener(lSymItem); B3.addItemListener(lSymItem); B4.addItemListener(lSymItem); B5.addItemListener(lSymItem); } //{{DECLARE_CONTROLS java.awt.Checkbox R4; CheckboxGroup Group1; java.awt.Checkbox M2; java.awt.Checkbox M3; java.awt.Checkbox M4; java.awt.Checkbox M5; java.awt.Checkbox R1; java.awt.Checkbox R2; java.awt.Checkbox R3; java.awt.Checkbox M1; java.awt.Checkbox R5; java.awt.Checkbox F1; java.awt.Checkbox F2; java.awt.Checkbox F3; java.awt.Checkbox F4; java.awt.Checkbox F5; java.awt.Checkbox B1; java.awt.Checkbox B2; java.awt.Checkbox B3; java.awt.Checkbox B4; java.awt.Checkbox B5; java.awt.Checkbox Blank; java.awt.TextArea Question; java.awt.TextArea Bonus; java.awt.TextArea Money; java.awt.TextArea Research_Funds; java.awt.TextArea Test_Results; java.awt.Button Decision_Yes; java.awt.Button Decision_No; java.awt.TextArea Decision_Question; java.awt.Button Response_Yes; java.awt.Button Response_No; java.awt.Button Response_Cancel; java.awt.Button Start_Exp; java.awt.Button Next_Test; java.awt.TextArea Feedback; java.awt.Label label1; java.awt.Label label2; java.awt.Label label3; java.awt.Label label4; java.awt.Label label5; java.awt.Label label6; java.awt.Label label7; java.awt.Label label8; java.awt.Label label9; java.awt.Label label10; java.awt.Label label11; java.awt.Button Test_Animal; //}} class SymMouse extends java.awt.event.MouseAdapter { public void mouseReleased(java.awt.event.MouseEvent event) { Object object = event.getSource(); if (object == Response_No) Response_No_MouseReleased(event); else if (object == Decision_Yes) Decision_Yes_MouseReleased(event); else if (object == Decision_No) Decision_No_MouseReleased(event); else if (object == Response_Yes) Response_Yes_MouseReleased(event); else if (object == Response_Cancel) Response_Cancel_MouseReleased(event); else if (object == Test_Animal) Test_Animal_MouseReleased(event); else if (object == Start_Exp) Start_Exp_MouseReleased(event); else if (object == Next_Test) Next_Test_MouseReleased(event); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void Next_Test_MouseReleased(java.awt.event.MouseEvent event) { //Button to increment the next test ++Test_Number; NextTEST = true; String comma = ", "; String output = First + comma + Second + comma + Third + comma + Forth + comma + Fifth; System.out.println(output); if (Test_Number ==2){ Question.setText(null); Question.append(Question2);} if (Test_Number ==3){ Question.setText(null); Question.append(Question3);} if (Test_Number ==4){ Question.setText(null); Question.append(Question4);} if (Test_Number ==5){ Question.setText(null); Question.append(Question5);} if (Test_Number ==6){ Question.setText(null); Question.append(Question6);} if (Test_Number ==7){ Question.setText(null); Question.append(Question7);} if (Test_Number ==8){ Question.setText(null); Question.append(Question8);} if (Test_Number ==9){ Question.setText(null); Question.append(Question9);} if (Test_Number ==10){ Question.setText(null); Question.append(Question10);} if (Test_Number ==11){ Question.setText(null); Question.append(Question11);} if (Test_Number ==12){ Question.setText(null); Question.append(Question12);} label10.setVisible(true); Feedback.setText(null); Next_Test.setVisible(false); Decision_Question.setVisible(false); label9.setVisible(false); Feedback.setVisible(false); label11.setVisible(true); Money.setVisible(true); test_money = 500; Test_Money = Test_Money.valueOf(test_money); Money.setText(null); Money.append(Test_Money); Decision_No.setVisible(false); Decision_Yes.setVisible(false); Blank.setState(true); Test_Animal.setVisible(false); Test_Results.setText(null); label4.setText("Are you ready to make a decision?"); if ( Test_Number == 1) Block = 1; if ( Test_Number == 2) Block = 1; if ( Test_Number == 3) Block = 1; if ( Test_Number == 4) Block = 2; if ( Test_Number == 5) Block = 2; if ( Test_Number == 6) Block = 2; if ( Test_Number == 7) Block = 3; if ( Test_Number == 8) Block = 3; if ( Test_Number == 9) Block = 3; if ( Test_Number == 10) Block = 4; if ( Test_Number == 11) Block = 4; if ( Test_Number == 12) Block = 4; if (Block ==1) { M1.setVisible(true); M1.setLabel("bat"); M2.setVisible(true); M2.setLabel("gorilla"); M3.setVisible(true); M3.setLabel("skunk"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("minnow"); F2.setVisible(true); F2.setLabel("piranha"); F3.setVisible(true); F3.setLabel("shark"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("lizard"); R2.setVisible(true); R2.setLabel("snake"); R3.setVisible(true); R3.setLabel("tortoise"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("hummingbird"); B2.setVisible(true); B2.setLabel("ostrich"); B3.setVisible(true); B3.setLabel("stork"); //B4.setVisible(true); //B5.setVisible(true); } //Block 2 "Bird?" if (Block == 2) { M1.setVisible(true); M1.setLabel("bat"); M2.setVisible(true); M2.setLabel("hippopotamus"); M3.setVisible(true); M3.setLabel("skunk"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("flying fish"); F2.setVisible(true); F2.setLabel("shark"); F3.setVisible(true); F3.setLabel("trout"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("alligator"); R2.setVisible(true); R2.setLabel("chameleon"); R3.setVisible(true); R3.setLabel("snake"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("flamingo"); B2.setVisible(true); B2.setLabel("robin"); B3.setVisible(true); B3.setLabel("ostrich"); //B4.setVisible(true); //B5.setVisible(true); } if (Block == 3) { M1.setVisible(true); M1.setLabel("gorilla"); M2.setVisible(true); M2.setLabel("skunk"); M3.setVisible(true); M3.setLabel("whale"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("goldfish"); F2.setVisible(true); F2.setLabel("swordfish"); F3.setVisible(true); F3.setLabel("shark"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("alligator"); R2.setVisible(true); R2.setLabel("chameleon"); R3.setVisible(true); R3.setLabel("snake"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("hawk"); B2.setVisible(true); B2.setLabel("hummingbird"); B3.setVisible(true); B3.setLabel("pelican"); //B4.setVisible(true); //B5.setVisible(true); } // Block 4 "Reptiles" if (Block == 4) { M1.setVisible(true); M1.setLabel("bat"); M2.setVisible(true); M2.setLabel("bear"); M3.setVisible(true); M3.setLabel("gorilla"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("blowfish"); F2.setVisible(true); F2.setLabel("goldfish"); F3.setVisible(true); F3.setLabel("piranha"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("chameleon"); R2.setVisible(true); R2.setLabel("crocodile"); R3.setVisible(true); R3.setLabel("salamander"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("penguin"); B2.setVisible(true); B2.setLabel("robin"); B3.setVisible(true); B3.setLabel("vulture"); //B4.setVisible(true); //B5.setVisible(true); } } void Start_Exp_MouseReleased(java.awt.event.MouseEvent event) { // Start button that Randomizes and Sets questions, and draws objects //Block 1 Blank.setState(true); Test_Results.setVisible(true); Test_Animal.setVisible(false); label1.setVisible(true); label5.setVisible(true); label6.setVisible(true); label7.setVisible(true); label8.setVisible(true); label10.setVisible(true); label11.setVisible(true); Money.setVisible(true); Test_Money = Test_Money.valueOf(test_money); Money.setText(null); Money.append(Test_Money); int Animal_Type_Randomizer; int Test_Randomizer; Test_Randomizer = 1 + (int) ( Math.random() * 4); Animal_Type_Randomizer = 1 + (int) ( Math.random() * 4); // if Test_Type = 1 all but animals in the prompt category are false // if Test_Type = 2 some animals in each category are true // if Test_Type = 3 only the single most similar animal is true if (Test_Randomizer == 1) { Test_Type1 = 1; Test_Type2 = 3; Test_Type3 = 2; Test_Type4 = 3; Test_Type5 = 1; Test_Type6 = 2; Test_Type7 = 1; Test_Type8 = 3; Test_Type9 = 2; Test_Type10 = 1; Test_Type11 = 2; Test_Type12 = 3; Animal_Type1 = Reptiles; Animal_Type2 = Mammal; Animal_Type3 = Birds; Animal_Type4 = Fish; Animal_Type5 = Birds; Animal_Type6 = Mammal; Animal_Type7 = Fish; Animal_Type8 = Birds; Animal_Type9 = Reptiles; Animal_Type10 = Mammal; Animal_Type11 = Fish; Animal_Type12 = Reptiles; } if (Test_Randomizer == 2) { Test_Type1 = 3; Test_Type2 = 2; Test_Type3 = 1; Test_Type4 = 2; Test_Type5 = 1; Test_Type6 = 3; Test_Type7 = 1; Test_Type8 = 3; Test_Type9 = 2; Test_Type10 = 1; Test_Type11 = 2; Test_Type12 = 3; Animal_Type1 = Mammal; Animal_Type2 = Birds; Animal_Type3 = Reptiles; Animal_Type4 = Mammal; Animal_Type5 = Fish; Animal_Type6 = Birds; Animal_Type7 = Mammal; Animal_Type8 = Fish; Animal_Type9 = Reptiles; Animal_Type10 = Birds; Animal_Type11 = Fish; Animal_Type12 = Reptiles; } if (Test_Randomizer == 3) { Test_Type1 = 3; Test_Type2 = 1; Test_Type3 = 2; Test_Type4 = 1; Test_Type5 = 3; Test_Type6 = 2; Test_Type7 = 1; Test_Type8 = 2; Test_Type9 = 3; Test_Type10 = 2; Test_Type11 = 1; Test_Type12 = 3; Animal_Type1 = Fish; Animal_Type2 = Birds; Animal_Type3 = Mammal; Animal_Type4 = Fish; Animal_Type5 = Birds; Animal_Type6 = Reptiles; Animal_Type7 = Mammal; Animal_Type8 = Fish; Animal_Type9 = Reptiles; Animal_Type10 = Birds; Animal_Type11 = Reptiles; Animal_Type12 = Mammal; } if (Test_Randomizer == 4) { Test_Type1 = 2; Test_Type2 = 1; Test_Type3 = 3; Test_Type4 = 1; Test_Type5 = 3; Test_Type6 = 2; Test_Type7 = 3; Test_Type8 = 1; Test_Type9 = 2; Test_Type10 = 1; Test_Type11 = 2; Test_Type12 = 3; Animal_Type1 = Birds; Animal_Type2 = Reptiles; Animal_Type3 = Mammal; Animal_Type4 = Fish; Animal_Type5 = Birds; Animal_Type6 = Mammal; Animal_Type7 = Reptiles; Animal_Type8 = Birds; Animal_Type9 = Fish; Animal_Type10 = Mammal; Animal_Type11 = Reptiles; Animal_Type12 = Fish; } if (Block ==1) { M1.setVisible(true); M1.setLabel("bat"); M2.setVisible(true); M2.setLabel("gorilla"); M3.setVisible(true); M3.setLabel("skunk"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("minnow"); F2.setVisible(true); F2.setLabel("piranha"); F3.setVisible(true); F3.setLabel("shark"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("lizard"); R2.setVisible(true); R2.setLabel("snake"); R3.setVisible(true); R3.setLabel("tortoise"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("hummingbird"); B2.setVisible(true); B2.setLabel("ostrich"); B3.setVisible(true); B3.setLabel("stork"); //B4.setVisible(true); //B5.setVisible(true); } //Block 2 "Bird?" if (Block == 2) { M1.setVisible(true); M1.setLabel("bat"); M2.setVisible(true); M2.setLabel("hippopotamus"); M3.setVisible(true); M3.setLabel("skunk"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("flying fish"); F2.setVisible(true); F2.setLabel("shark"); F3.setVisible(true); F3.setLabel("trout"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("alligator"); R2.setVisible(true); R2.setLabel("chameleon"); R3.setVisible(true); R3.setLabel("snake"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("flamingo"); B2.setVisible(true); B2.setLabel("robin"); B3.setVisible(true); B3.setLabel("ostrich"); //B4.setVisible(true); //B5.setVisible(true); } if (Block == 3) { M1.setVisible(true); M1.setLabel("gorilla"); M2.setVisible(true); M2.setLabel("skunk"); M3.setVisible(true); M3.setLabel("whale"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("goldfish"); F2.setVisible(true); F2.setLabel("swordfish"); F3.setVisible(true); F3.setLabel("shark"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("alligator"); R2.setVisible(true); R2.setLabel("chameleon"); R3.setVisible(true); R3.setLabel("snake"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("hawk"); B2.setVisible(true); B2.setLabel("hummingbird"); B3.setVisible(true); B3.setLabel("pelican"); //B4.setVisible(true); //B5.setVisible(true); } // Block 4 "Reptiles" if (Block == 4) { M1.setVisible(true); M1.setLabel("bat"); M2.setVisible(true); M2.setLabel("bear"); M3.setVisible(true); M3.setLabel("gorilla"); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F1.setLabel("blowfish"); F2.setVisible(true); F2.setLabel("goldfish"); F3.setVisible(true); F3.setLabel("piranha"); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R1.setLabel("chameleon"); R2.setVisible(true); R2.setLabel("crocodile"); R3.setVisible(true); R3.setLabel("salamander"); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B1.setLabel("penguin"); B2.setVisible(true); B2.setLabel("robin"); B3.setVisible(true); B3.setLabel("vulture"); //B4.setVisible(true); //B5.setVisible(true); } Trait = "Big Noses"; Question1 =Start + Animal_Type1 + have + Trait + End + Animal_Type1 + have + Trait; Question2 =Start + Animal_Type2 + have + Trait + End + Animal_Type2 + have + Trait; Question3 =Start + Animal_Type3 + have + Trait + End + Animal_Type3 + have + Trait; Question4 =Start + Animal_Type4 + have + Trait + End + Animal_Type4 + have + Trait; Start_Exp.setVisible(false); Question.setVisible(true); Question.append(Question1); } void Decision_No_MouseReleased(java.awt.event.MouseEvent event) { ++Question_Number; label4.setVisible(false); Decision_Yes.setVisible(false); Decision_No.setVisible(false); label10.setVisible(true); label11.setVisible(true); Money.setVisible(true); Blank.setState(true); if (Question_Number > 4) { label4.setText("You must make a decision (Click Yes.)"); label4.setVisible(true); Decision_Yes.setVisible(true); Decision_No.setVisible(false); label10.setVisible(false); label11.setVisible(false); Money.setVisible(false); Blank.setState(true); } } void Decision_Yes_MouseReleased(java.awt.event.MouseEvent event) { // button1 has label "Yes" Decision_Yes.setVisible(false); Decision_No.setVisible(false); label4.setVisible(false); Response_Yes.setVisible(true); Response_No.setVisible(true); Response_Cancel.setVisible(true); Test_Animal.setVisible(false); Blank.setState(true); label10.setVisible(false); label11.setVisible(false); Money.setVisible(false); String temp = null; if (Test_Number == 1){ temp = Animal_Type1 ;} if (Test_Number == 2){ temp = Animal_Type2 ;} if (Test_Number == 3){ temp = Animal_Type3 ;} if (Test_Number == 4){ temp = Animal_Type4 ;} if (Test_Number == 5){ temp = Animal_Type5 ;} if (Test_Number == 6){ temp = Animal_Type6 ;} if (Test_Number == 7){ temp = Animal_Type7 ;} if (Test_Number == 8){ temp = Animal_Type8 ;} if (Test_Number == 9){ temp = Animal_Type9 ;} if (Test_Number == 10){ temp = Animal_Type10 ;} if (Test_Number == 11){ temp = Animal_Type11 ;} if (Test_Number == 12){ temp = Animal_Type12 ;} Decision_Question.setText(null); Decision_Question.setVisible(true); Decision_Question.append("Do only " ); Decision_Question.append(temp); Decision_Question.append(" have "); Decision_Question.append(Trait); Decision_Question.append("?"); } void Response_No_MouseReleased(java.awt.event.MouseEvent event) { // button3 has label "No" NextTEST= false; label9.setVisible(true); label3.setVisible(true); label2.setVisible(true); Bonus.setVisible(true); Research_Funds.setVisible(true); Feedback.setVisible(true); Response_Yes.setVisible(false); Response_No.setVisible(false); Response_Cancel.setVisible(false); Decision_Yes.setVisible(false); Next_Test.setVisible(true); Blank.setState(true); /*M1.setVisible(true); M2.setVisible(true); M3.setVisible(true); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F2.setVisible(true); //F3.setVisible(true); //F4.setVisible(true); F5.setVisible(true); R1.setVisible(true); R2.setVisible(true); R3.setVisible(true); //R4.setVisible(true); //R5.setVisible(true); B1.setVisible(true); B2.setVisible(true); B3.setVisible(true); //B4.setVisible(true); //B5.setVisible(true); */ int holder = 0; if (Test_Number == 1 ) { holder = Test_Type1;} if (Test_Number == 2 ) { holder = Test_Type2;} if (Test_Number == 3 ) { holder = Test_Type3;} if (Test_Number == 4 ) { holder = Test_Type4;} if (Test_Number == 5 ) { holder = Test_Type5;} if (Test_Number == 6 ) { holder = Test_Type6;} if (Test_Number == 7 ) { holder = Test_Type7;} if (Test_Number == 8 ) { holder = Test_Type8;} if (Test_Number == 9 ) { holder = Test_Type9;} if (Test_Number == 10 ) { holder = Test_Type10;} if (Test_Number == 11) { holder = Test_Type11;} if (Test_Number == 12) { holder = Test_Type12;} //Correct test response for the given condition if (holder == 2 || holder == 3 ) { Results = "You are correct."; Feedback.setText(null); Feedback.setText(Results); ResearchNumber = ResearchNumber + Successful_Test; BonusNumber = BonusNumber + test_money; //Research_Funds.setText(null); String rf = null; rf = rf.valueOf(ResearchNumber); Research_Funds.setText(rf); //Bonus.setText(null); String b = null; b = b.valueOf(BonusNumber); Bonus.setText(b); Question_Number = 0; } //Wrong answer for the possible cases if (holder == 1) { Results = "You are incorrect."; Feedback.setText(null); Feedback.append(Results); //Research_Funds.setText(null); String rf = null; rf = rf.valueOf(ResearchNumber); Research_Funds.setText(rf); //Bonus.setText(null); String b = null; b = b.valueOf(BonusNumber); Bonus.setText(b); Question_Number = 0; } } void Response_Yes_MouseReleased(java.awt.event.MouseEvent event) { NextTEST= false; Response_Yes.setVisible(false); Response_No.setVisible(false); Response_Cancel.setVisible(false); Decision_Yes.setVisible(false); Next_Test.setVisible(true); Bonus.setVisible(true); Research_Funds.setVisible(true); label2.setVisible(true); label3.setVisible(true); label9.setVisible(true); Feedback.setVisible(true); Blank.setState(true); /* M1.setVisible(true); M2.setVisible(true); M3.setVisible(true); //M4.setVisible(true); //M5.setVisible(true); F1.setVisible(true); F2.setVisible(true); F3.setVisible(true); //F4.setVisible(true); //F5.setVisible(true); R1.setVisible(true); R2.setVisible(true); //R3.setVisible(true); //R4.setVisible(true); R5.setVisible(true); B1.setVisible(true); B2.setVisible(true); B3.setVisible(true); //B4.setVisible(true); //B5.setVisible(true); */ int holder = 0; if (Test_Number == 1 ) { holder = Test_Type1;} if (Test_Number == 2 ) { holder = Test_Type2;} if (Test_Number == 3 ) { holder = Test_Type3;} if (Test_Number == 4 ) { holder = Test_Type4;} if (Test_Number == 5 ) { holder = Test_Type5;} if (Test_Number == 6 ) { holder = Test_Type6;} if (Test_Number == 7 ) { holder = Test_Type7;} if (Test_Number == 8 ) { holder = Test_Type8;} if (Test_Number == 9 ) { holder = Test_Type9;} if (Test_Number == 10 ) { holder = Test_Type10;} if (Test_Number == 11) { holder = Test_Type11;} if (Test_Number == 12) { holder = Test_Type12;} //Correct test response for the given condition if (holder == 1) { Results = "You are correct."; Feedback.append(Results); ResearchNumber = ResearchNumber + Successful_Test; BonusNumber = BonusNumber + test_money; //Research_Funds.setText(null); String rf = null; rf = rf.valueOf(ResearchNumber); Research_Funds.setText(rf); //Bonus.setText(null); String b = null; b = b.valueOf(BonusNumber); Bonus.setText(b); Question_Number = 0; //Test_Results.append(null); } //Wrong answer for the possible cases else if (holder == 2 || holder == 3 ) { Results = "You are incorrect."; Feedback.append(Results); //Question.setText(null); //Research_Funds.setText(null); String rf = null; rf = rf.valueOf(ResearchNumber); Research_Funds.setText(rf); //Bonus.setText(null); String b = null; b = b.valueOf(BonusNumber); Bonus.setText(b); Question_Number = 0; //Test_Results.append(null); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void Test_Animal_MouseReleased(java.awt.event.MouseEvent event) { First = null; Second = null; Third = null; Forth = null; Fifth = null; Decision_Yes.setVisible(true); Decision_No.setVisible(true); Test_Animal.setVisible(false); label4.setVisible(true); label10.setVisible(false); //Test_Results.setText(null); test_money = test_money - Test_Cost; Test_Money = Test_Money.valueOf(test_money); Money.setText(null); Money.append(Test_Money); if(M1.getState() == true) M1.setVisible(false); if(M2.getState() == true) M2.setVisible(false); if(M3.getState() == true) M3.setVisible(false); if(M4.getState() == true) M4.setVisible(false); if(M5.getState() == true) M5.setVisible(false); if(F1.getState() == true) F1.setVisible(false); if(F2.getState() == true) F2.setVisible(false); if(F3.getState() == true) F3.setVisible(false); if(F4.getState() == true) F4.setVisible(false); if(F5.getState() == true) F5.setVisible(false); if(R1.getState() == true) R1.setVisible(false); if(R2.getState() == true) R2.setVisible(false); if(R3.getState() == true) R3.setVisible(false); if(R4.getState() == true) R4.setVisible(false); if(R5.getState() == true) R5.setVisible(false); if(B1.getState() == true) B1.setVisible(false); if(B2.getState() == true) B2.setVisible(false); if(B3.getState() == true) B3.setVisible(false); if(B4.getState() == true) B4.setVisible(false); if(B5.getState() == true) B5.setVisible(false); String Type = null; //String comma = ", "; if (Question_Number == 1){First = Button_Label; } if (Question_Number == 2){Second = Button_Label; } if (Question_Number == 3){Third = Button_Label; } if (Question_Number == 4){Forth = Button_Label; } if (Question_Number == 5){Fifth = Button_Label; } if (Test_Number == 1) {Type = Animal_Type1; } if (Test_Number == 2) {Type = Animal_Type2; } if (Test_Number == 3) {Type = Animal_Type3; } if (Test_Number == 4) {Type = Animal_Type4; } if (Test_Number == 5) {Type = Animal_Type5; } if (Test_Number == 6) {Type = Animal_Type6; } if (Test_Number == 7) {Type = Animal_Type7; } if (Test_Number == 8) {Type = Animal_Type8; } if (Test_Number == 9) {Type = Animal_Type9; } if (Test_Number == 10) {Type = Animal_Type10; } if (Test_Number == 11) {Type = Animal_Type11; } if (Test_Number == 12) {Type = Animal_Type12; } String b = " has the " + Trait + "\n"; String a = Button_Label; // if Test_Type = 1 all but animals in the prompt category are false // if Test_Type = 2 some animals in each category are true // if Test_Type = 3 only the single most similar animal is true //Default Test_Type is 1 // Mammals // if (Tested_Animal == "M1") { if ( Type == Reptiles || Type == Fish || Type == Birds) { b = " does not have the " + Trait + "\n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M2") { if ( Type == Reptiles || Type == Fish || Type == Birds) { b = " does not have the " + Trait + "\n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M3") { if ( Type == Reptiles || Type == Fish || Type == Birds) { b = " does not have the " + Trait + "\n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M4") { if ( Type == Reptiles || Type == Fish || Type == Birds) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M5") { if ( Type == Reptiles || Type == Fish || Type == Birds) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } //Reptiles else if (Tested_Animal == "R1") { if ( Type == Mammal || Type == Birds || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R2") { if ( Type == Mammal || Type == Birds || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R3") { if ( Type == Mammal || Type == Birds || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R4") { if ( Type == Mammal || Type == Birds || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R5") { if ( Type == Mammal || Type == Birds || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } //Fish else if (Tested_Animal == "F1") { if ( Type == Mammal || Type == Birds || Type == Reptiles ) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F2") { if ( Type == Mammal || Type == Birds || Type == Reptiles ) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F3") { if ( Type == Mammal || Type == Birds || Type == Reptiles ) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F4") { if ( Type == Mammal || Type == Birds || Type == Reptiles ) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F5") { if ( Type == Mammal || Type == Birds || Type == Reptiles ) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } //Birds else if (Tested_Animal == "B1") { if ( Type == Mammal || Type == Reptiles || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B2") { if ( Type == Mammal || Type == Reptiles || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B3") { if ( Type == Mammal || Type == Reptiles || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B4") { if ( Type == Mammal || Type == Reptiles || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B5") { if ( Type == Mammal || Type == Reptiles || Type == Fish) { b = " does not have the " + Trait + " \n"; } Animal_Report = a + b; Test_Results.append(Animal_Report); } Blank.setState(true); Tested_Animal = ""; /////////////////////////////////////////////////////////////// /*if (Question_Number == 2) { if (Tested_Animal == "R4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } } //////////////////////////////////////////////////////////////// if (Question_Number == 3) { if (Tested_Animal == "R4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } } ///////////////////////////////////////////////////////////// if (Question_Number == 4) { if (Tested_Animal == "R4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } } //////////////////////////////////////////////////////////// if (Question_Number == 5) { if (Tested_Animal == "R4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "M5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "R5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "F5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B1") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B2") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B3") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B4") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } else if (Tested_Animal == "B5") { String a = Tested_Animal; String b = " has the property \n"; Animal_Report = a + b; Test_Results.append(Animal_Report); } }*/ if (Question_Number == 6) { String done = "You must make a decision based on the above information."; Test_Results.append(done); } } void Response_Cancel_MouseReleased(java.awt.event.MouseEvent event) { // Labeled "Cancel" Response_Yes.setVisible(false); Response_No.setVisible(false); Response_Cancel.setVisible(false); Decision_Question.setVisible(false); Decision_Yes.setVisible(true); Decision_No.setVisible(true); label4.setVisible(true); } class SymItem implements java.awt.event.ItemListener { public void itemStateChanged(java.awt.event.ItemEvent event) { Object object = event.getSource(); if (object == R4) R4_ItemStateChanged(event); else if (object == M2) M2_ItemStateChanged(event); else if (object == M3) M3_ItemStateChanged(event); else if (object == M4) M4_ItemStateChanged(event); else if (object == M5) M5_ItemStateChanged(event); else if (object == R1) R1_ItemStateChanged(event); else if (object == R2) R2_ItemStateChanged(event); else if (object == R3) R3_ItemStateChanged(event); else if (object == M1) M1_ItemStateChanged(event); else if (object == R5) R5_ItemStateChanged(event); else if (object == F1) F1_ItemStateChanged(event); else if (object == F2) F2_ItemStateChanged(event); else if (object == F3) F3_ItemStateChanged(event); else if (object == F4) F4_ItemStateChanged(event); else if (object == F5) F5_ItemStateChanged(event); else if (object == B1) B1_ItemStateChanged(event); else if (object == B2) B2_ItemStateChanged(event); else if (object == B3) B3_ItemStateChanged(event); else if (object == B4) B4_ItemStateChanged(event); else if (object == B5) B5_ItemStateChanged(event); } } void R4_ItemStateChanged(java.awt.event.ItemEvent event) { Tested_Animal = "R4"; Button_Label = R4.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void M2_ItemStateChanged(java.awt.event.ItemEvent event) { Tested_Animal = "M2"; Button_Label = M2.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void M3_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "M3"; Button_Label = M3.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void M4_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "M4"; Button_Label = M4.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void M5_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "M5"; Button_Label = M5.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void R1_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "R1"; Feedback.setText(null); Button_Label = R1.getLabel(); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void R2_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "R2"; Button_Label = R2.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void R3_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "R3"; Button_Label = R3.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void M1_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "M1"; Button_Label = M1.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void R5_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "R5"; Button_Label = R5.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void F1_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "F1"; Button_Label = R4.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void F2_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "F2"; Button_Label = F2.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void F3_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "F3"; Button_Label = F3.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void F4_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "F4"; Button_Label = F4.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void F5_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "F5"; Button_Label = F5.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void B1_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "B1"; Button_Label = B1.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void B2_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "B2"; Button_Label = B2.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void B3_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "B3"; Button_Label = B3.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void B4_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "B4"; Button_Label = B4.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } void B5_ItemStateChanged(java.awt.event.ItemEvent event) { // to do: code goes here. Tested_Animal = "B5"; Button_Label = B5.getLabel(); Feedback.setText(null); Decision_Question.setText(null); if (Decision_Yes.isVisible() == false && NextTEST == true ){Test_Animal.setVisible(true);} } }