Skip to content

Instantly share code, notes, and snippets.

@PHCoder05
Last active February 13, 2022 18:53
Show Gist options
  • Select an option

  • Save PHCoder05/0ea7e7fd6eed795f5d6e290939b47b88 to your computer and use it in GitHub Desktop.

Select an option

Save PHCoder05/0ea7e7fd6eed795f5d6e290939b47b88 to your computer and use it in GitHub Desktop.
my first git having percentage calculator
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("%");
}
}
@PHCoder05
Copy link
Author

percentage Calculator using Java this is my first Programe using Java .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment