JAVA CODE

// Result program
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class Result extends Applet
             implements ActionListener
{
  Label Prompt;
  TextField ScoreText;
  int Score;

  public void init()
  {
    Prompt = new Label ("Enter score ");
    add(Prompt);

    ScoreText = new TextField(3);
    add(ScoreText);
    ScoreText.addActionListener(this);
  }
  public void paint( Graphics g )
  {
    if ((Score>=90)&&(Score<100))
       g.drawString(" A ", 10, 50 );
    if ((Score>=80)&&(Score<90))
       g.drawString(" B ", 10, 50 );
    if ((Score>=70)&&(Score<80))
       g.drawString(" C ", 10, 50 );
    if ((Score>=60)&&(Score<80))
       g.drawString(" D ", 10, 50 );
    if ((Score>=0)&&(Score<60))
       g.drawString(" F ", 10, 50 );
   }
   public void actionPerformed ( ActionEvent e )
   {
     Score = Integer.valueOf(ScoreText.getText()).intValue();
     repaint();
   }
}