Java Programming Exercise 1: CBSE Board Percentage Calculator

 package com.company;

import java.util.Scanner;


public class tuts {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println("Welcome Please Press 1 To Continue");

        int enter = sc.nextInt();

        System.out.println("Please Enter the Marks out of :");

        int g = sc.nextInt();

        System.out.println("Note: Enter the CBSE Marks as per subject");

        System.out.println("Enter Marks of English: ");

        float a = sc.nextFloat();

//        System.out.println("Enter Marks of Hindi: ");

//        float b = sc.nextFloat();

        System.out.println("Enter Marks of Social Science: ");

        float c = sc.nextFloat();

        System.out.println("Enter Marks of Computer Science: ");

        float d = sc.nextFloat();

        System.out.println("Enter Marks of Science: ");

        float e = sc.nextFloat();

        System.out.println("Enter Marks of Maths: ");

        float f = sc.nextFloat();

        System.out.println("Percentage of the marks given is :");

        float percent = ((a+c+d+e+f)/500)*100;

        System.out.println(percent);


    }

}


Comments

Popular posts from this blog

Creating a Thread by Extending Thread class

Constructors from Thread class in Java