×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Sahil Yadav
Added: Apr 9, 2021 4:10 AM
Views: 3959
Tags: no tags
  1.  
  2. package cwhpro1;
  3. import java.util.Scanner;
  4. public class Excersise_1 {
  5.  
  6.     /**
  7.      *
  8.      * @param args
  9.      */
  10.     public static void  main(String[] args){
  11.    
  12.         System.out.println("Enter Your Name");
  13.         Scanner n = new Scanner(System.in);
  14.         String m = n.nextLine();
  15.                 System.out.println("");
  16.  
  17.         System.out.println("Welcome,'"+m+"' Want To Calculate Percentage for CBSE Board"
  18.                 +"So Entre Your Marks'As Per the Instruction's'");
  19.        
  20.         Scanner sa = new Scanner(System.in);
  21.         System.out.println("");
  22.         System.out.println("Enter your maks in 'English'");
  23.         double a = sa.nextDouble();
  24.        
  25.                 System.out.println("");
  26.  
  27.          System.out.println("Enter your maks in 'Maths'");
  28.         double b = sa.nextDouble();
  29.        
  30.                 System.out.println("");
  31.          System.out.println("Enter your maks in 'Science'");
  32.         double c = sa.nextDouble();
  33.        
  34.                 System.out.println("");
  35.          System.out.println("Enter your maks in 'Hindi'");
  36.         double d = sa.nextDouble();
  37.        
  38.                 System.out.println("");
  39.          System.out.println("Enter your maks in 'Social Science'");
  40.         double e = sa.nextDouble();
  41.        
  42.                 System.out.println("");
  43.         System.out.println("'"+m+"' Your Percentage is ");
  44.         double f = (a+b+c+d+e)/500*100;
  45.         System.out.print(f);
  46.         System.out.println("%");
  47. }
  48.  
  49. }