Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions percentage_calculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.company;
import java.util.Scanner;

public class percentage_calculator {
public static void main(String[] args) {
System.out.println("This is the percentage calculator of the CBSE Board for 5 subjects: ");
Scanner scan = new Scanner(System.in);
System.out.println("Enter the Marks of the subject 'English': ");
int marks1 = scan.nextInt();
System.out.println("Enter the Marks of the subject 'Mathematics': ");
int marks2 = scan.nextInt();
System.out.println("Enter the Marks of the subject 'Science': ");
int marks3 = scan.nextInt();
System.out.println("Enter the Marks of the subject 'Social Science': ");
int marks4 = scan.nextInt();
System.out.println("Enter the Marks of the subject 'Marathi': ");
int marks5 = scan.nextInt();
float total = marks1 + marks2 + marks3 + marks4 + marks5;
System.out.println("The total of the marks is: "+total);
float percentage = (total/500)*100;
System.out.println("The percentage of the student according to the scored marks is: "+percentage);
}
}