SHARE
TWEET

Untitled

a guest Dec 14th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*Andrew Oughton
  2.  *9/20/12
  3.  *Prints out a comment based on an letter grade
  4.  */
  5.  
  6.  import java.text.DecimalFormat;
  7.  import TerminalIO. KeyboardReader;
  8.  
  9.  class OughtonPrg5{
  10.    
  11.     public static void main(String args[]){
  12.        
  13.         KeyboardReader reader = new KeyboardReader();
  14.        
  15.         char grade;
  16.         double i;
  17.        
  18.         for(i = 1; i <= 4; i = i+1){
  19.            
  20.             System.out.println("\nEnter the letter grade in capitols.");
  21.            
  22.             grade=reader.readChar();
  23.            
  24.             if(grade=='A')System.out.println("Excellent.");
  25.             if(grade=='B')System.out.println("Good.");
  26.             if(grade=='C')System.out.println("Average.");
  27.             if(grade=='D')System.out.println("Poor.");
  28.             if(grade=='E')System.out.println("Failing.");
  29.             if(grade=='F')System.out.println("Failing.");
  30.         }
  31.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top