Java Program To Calculate CGPA Percentage


Introduction

In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class CGPA {
       public static void main(String arg[]) {
       int num = 5;

       double mm[] = new double[num];

       double gg[] = new double[num];

        double cgpa, sum = 0;

        mm[0] = 95;

        mm[1] = 85;

        mm[2] = 75;

        mm[3] = 80;

        mm[4] = 95;

            for (int i = 0; i < num; i++) {
            gg[i] = (mm[i] / 10);
            }

            for (int i = 0; i < num; i++) {
            sum += gg[i];
            }

        cgpa = sum / num;

        System.out.println("CGPA = " + cgpa);

        System.out.println("percantage from CGPA = " + cgpa * 9.5);

                                }
}

Result

java techstudy.org

     





Related Topics




Popular Posts