Share all news to all guy ;)

Saturday, December 20, 2014



Here is Java code to find a Grade of Student , we must to input Quiz , Mid Term , and Final Score to see a Result Grade of Student ;) .
You can copy this code to run on your computer :


public static void main(String[] args) {
        double Quiz ,MidTerm,FinalScore,Avg;
        Scanner Output = new Scanner (System.in);
       
        System.out.println("Quiz: ");
        Quiz = Output.nextDouble();
        System.out.println("Mid Term: ");
        MidTerm = Output.nextDouble();
        System.out.println("Final Score: ");
        FinalScore = Output.nextDouble();
       
        Avg = (Quiz + MidTerm + FinalScore);
        System.out.println("Total Average: " + Avg);
       
        if(Avg >=90 && Avg<=100)
            System.out.println("Grade: A");
        else if(Avg >=70 && Avg<90)
            System.out.println("Grade: B");
        else if(Avg >=50 && Avg<70)
            System.out.println("Grade: C");
        else
            System.out.println("GradeF");
               
    }
   
}

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.