You have two assignments to pick from. JUST DO ONE! ONLY DO ONE! YOU CAN ONLY GET POINTS FOR ONE! You can only get 7 points. ONLY DO 7 OF THE THINGS. DON'T DO ALL 8. The Stack of Plates ------------------- You should make a program that shows the numbers a person has pushed in order by time. When the user presses the delete key, the most recent number disappears. When the user presses a number key, the new number is added to the top. * There is an array that holds the numbers. * When you press the delete key, the most recent number disappears. * When you enter a number, it appears on top. * The bottom (first entered) number is at (100,500). * Works with letters as well as numbers. * The array can flip when the user wants (might be hard. do last) * Uses the buttun class to clear the display. * Turned in by Wednesday of finals week at 4pm. Hint: If you want to get an integer from a keypress, you can do this: int integerTheyPressed = ke.getKeyChar() - '0'; I will help with this for anyone who wants. The Head Bopper --------------- You should make an object named 'Head'. The program should display five heads. When the user clicks on a head, that head should turn into something else (be creative). * There is both a main class and a helper class. * The helper class has a paint method. * The helper class has x and y variables that tell where it is. * Different heads have different sizes. * The helper class has a 'clicked(int mouseX, int mouseY)' method that changes the icon if the mouse clicks on the icon. * The program can print the number of icons still in the original (unclicked) shape. (This might be hard. Do last.) * Uses the buttun class to reset the display. * Turned in by Tuesday of finals week at 4pm. The Program --------------------------------- import java.awt.*; import java.awt.event.*; public class Thing extends java.applet.Applet implements MouseListener { Buttun up, down; int number; public Thing() { up = new Buttun(200,50,"Up"); down = new Buttun(200,100,"Down"); addMouseListener(this); } public void paint(Graphics g) { up.paint(g); down.paint(g); g.drawString(""+number, 100, 75); } public void mouseClicked(MouseEvent me) { int x = me.getX(); int y = me.getY(); if (up.clicked(x,y) ) { number++; } else if (down.clicked(x,y) ) { number--; } repaint(); } public void mousePressed(MouseEvent me) {} public void mouseReleased(MouseEvent me) {} public void mouseEntered(MouseEvent me) {} public void mouseExited(MouseEvent me) {} } class Buttun { int x, y; String text; public Buttun(int newX, int newY, String newText) { x = newX; y = newY; text = newText; } public void paint(Graphics g) { g.drawRoundRect(x,y,50,30,15,15); g.drawString(text, x+5,y+25); } public boolean clicked(int mouseX, int mouseY) { if (mouseX >= x && mouseX <= x+50 && mouseY >= y && mouseY <= y+30 ) { return true; } else { return false; } } }