Zeek_06_BoardPercentage.java

 

//Calculate Board percentage using user-input for 5 subjects...

//Use float or double because percentage can be in decimals
package com.company;

import java.util.Scanner;

public class Zeek_06_BoardPercentage {
    public static void main(String[] args) {
        
        System.out.println("5 subjects with maximum 100 marks for each subject");
        
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter Marks of 1st subject:");
        float asc.nextInt();
        
        System.out.println("Enter Marks of 2nd subject:");
        float bsc.nextInt();
        
        System.out.println("Enter Marks of 3rd subject:");
        float csc.nextInt();
        
        System.out.println("Enter Marks of 4th subject:");
        float dsc.nextInt();
        
        System.out.println("Enter Marks of 5th subject:");
        float esc.nextInt();
        
        float f=a+b+c+d+e;
        float g= (f*100)/500;
        System.out.println("Your total marks out of 500 is  "+f);
        System.out.println("Your overall percentage is  "+g);
    }
    
}

Comments

Popular posts from this blog

Zeek_31_MethodInJava.java