3-4 Exam Grade

posted Feb 8, 2014, 10:16 AM by dldar masud   [ updated Feb 8, 2014, 10:16 AM by Karwan Jacksi ]
// this program to exam grade 

package exam.grade;
import java.util.Scanner;

public class ExamGrade {

   
    public static void main(String[] args) {
        // TODO code application logic here
        int mark;
        
        System.out.println("Hello Guest! \n Welcome to Exam Grade Program! \n \n Please enter your score:");
        
        Scanner k=new Scanner(System.in);
        mark=k.nextInt();
        System.out.print("Your grade for your score is "); 
       switch((int)(mark/10))
{
case 10:  ;
case 9:   ;
{
System.out.println("Excellent");
}
break;
case 8:System.out.println(" V.Good");break;
                    
                case 7:System.out.println("Good"); break;
                    
case 6:System.out.println(" Fair");break;
                    
case 5:System.out.println("Pass");break;
                    
case 4:  ;
case 3:   ;
       case 2:   ;    
case 1:   ;
       case 0:System.out.println(" Fail"); break;
                     
       default:System.out.println("error has occurred");
}
    }
}

ċ
ExamGrade.java
(1k)
Karwan Jacksi,
Feb 8, 2014, 10:16 AM
Comments