/*****************************************************************
** Grades - program to demonstrate nested if statements
**
** This program prompts the user to enter an exam mark.  The mark
** is output as a letter grade.
**
** A sample dialogue with this program is
**
**       PROMPT>java Grades
**       Enter your mark in percent: 73.2
**       You got a B
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.io.*;

public class Grades
{
   public static void main(String[] args) throws IOException
   {
      BufferedReader stdin =
         new BufferedReader(new InputStreamReader(System.in), 1);

      System.out.print("Enter your mark in percent: ");

      double mark = Double.parseDouble(stdin.readLine());

      if (mark >= 80)
         System.out.println("You got an A");
      else if (mark >= 70)
         System.out.println("You got a B");
      else if (mark >= 60)
         System.out.println("You got a C");
      else if (mark >= 50)
         System.out.println("You got a D");
      else
         System.out.println("You got an F");
   }
}

