Friday, 24 January 2020

Write a java program to input marks of 5 student if 5 subject out of 100 marks each , output sum and percentage of marks and appropriate division i.e distigusion first class upto fail


Programe :

import java.util.*;

class Student

{

public static void main(String args[]) 

  {   

Scanner s = new Scanner(System.in);

int M , E , A , S , G , Total; float percentage ;


System.out.println("Enter the marks of 5 subject :");

M = s.nextInt();

E = s.nextInt();

                    A = s.nextInt();

                     S = s.nextInt();

G = s.nextInt();


Total = M + E + A + S + G ;

                     System.out.println("Total is : " +Total);


percentage = (Total * 100) /500;

System.out.println("Percentage is :" +percentage);


if (percentage >= 90 )

                      System.out.println(" First class ");


else if (percentage >= 65 ) 

System.out.println(" Second Class ");


                       else if ( percentage >= 40)

                       System.out.println(" Third Class ");


                       else

                       System.out.println(" Fail ");   

 }

}


Output :




No comments:

Post a Comment

Write a java program to input marks of 5 student if 5 subject out of 100 marks each , output sum and percentage of marks and appropriate division i.e distigusion first class upto fail

Programe : import java.util.*; class Student { public static void main(String args[])     {     Scanner s = ...