Last active
February 13, 2022 18:53
-
-
Save PHCoder05/0ea7e7fd6eed795f5d6e290939b47b88 to your computer and use it in GitHub Desktop.
my first git having percentage calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.company; | |
| import java.util.Scanner; | |
| public class Exercise_1 { | |
| public static void main(String[] args) { | |
| System.out.println("Calculating marks of CBSC students"); | |
| Scanner sc = new Scanner(System.in); | |
| System.out.println("write 1st subject and it's Marks "); | |
| String a = sc.next(); | |
| int b = sc.nextInt(); | |
| System.out.println("write 2nd subject and it's Marks "); | |
| String c = sc.next(); | |
| int d = sc.nextInt(); | |
| System.out.println("write 3rd subject and it's Marks "); | |
| String e = sc.next(); | |
| int f = sc.nextInt(); | |
| System.out.println("write 4rth subject and it's Marks "); | |
| String g = sc.next(); | |
| int h = sc.nextInt(); | |
| System.out.println("write 5th subject and it's Marks "); | |
| String i = sc.next(); | |
| int j = sc.nextInt(); | |
| float total = b+d+f+h+j; | |
| System.out.println("Total percentage you got =" ); | |
| System.out.println(total/500*100); | |
| System.out.print("%"); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
percentage Calculator using Java this is my first Programe using Java .