S A M P L E Quiz #2 Name ___________________ Honor Code________________________ Section _____ (Note: Getting your Name and Section right is worth one point. If we can't decipher your name or section, it's wrong.) A. Assume the applet below is run on the Web or the appletviewer. On the back, sketch what the screen would look like after the middle button is pushed. import java.awt.*; import java.awt.event.*; public class Drive extends java.applet.Applet implements ActionListener { TextField mInstruct,mAnswer; Button bRed,bGreen,bYellow; public void init () { mInstruct = new TextField(80); mInstruct.setText("Your driving lesson has begun. Press a button"); bRed = new Button("Red"); bGreen = new Button("Green"); bYellow = new Button("Yellow"); mAnswer = new TextField(80); bRed.addActionListener(this); bGreen.addActionListener(this); bYellow.addActionListener(this); add(mInstruct) ; add(bRed) ; add(bGreen) ; add(bYellow) ; add(mAnswer) ; } public void actionPerformed(ActionEvent event) { Object cause = event.getSource(); if (cause == bRed) { mAnswer.setText("I guess you had better stop."); } if (cause == bGreen) { mAnswer.setText("Keep on rolling along."); } if (cause == bYellow) { mAnswer.setText("Step on it! You can still get through!"); } } } B. Possibly one or two more specific questions about what a particular lines does.