0% found this document useful (0 votes)
2 views4 pages

University CGPA Calculator Java

The document outlines a project to create a Java-based CGPA calculator that adjusts calculations based on different university formulas. It includes modules for inputting university names, subject grades, and calculating SGPA and CGPA, with a simple file I/O for data storage. The project can be further enhanced with a graphical user interface and database support.

Uploaded by

chaitalibonde5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

University CGPA Calculator Java

The document outlines a project to create a Java-based CGPA calculator that adjusts calculations based on different university formulas. It includes modules for inputting university names, subject grades, and calculating SGPA and CGPA, with a simple file I/O for data storage. The project can be further enhanced with a graphical user interface and database support.

Uploaded by

chaitalibonde5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

University-Based CGPA Calculator using Java

Project Title: University-Based CGPA Calculator

Objective:

To develop a Java-based application that calculates SGPA and CGPA based on the student's

university.

Each university may have a different calculation formula, and the system adjusts accordingly.

Modules:

1. Input University Name

2. Enter Subject Grades/Credits

3. Apply Formula Based on University

4. Calculate SGPA and CGPA

5. Display and Save Results

Technologies Used:

- Java (Swing/AWT)

- File I/O for simple data storage

- No database used for simplicity

Source Code Overview:

Main.java

---------

import java.util.*;
public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.println("Enter University Name:");

String uni = sc.nextLine().toLowerCase();

System.out.print("Enter number of subjects: ");

int n = sc.nextInt();

double[] gradePoints = new double[n];

int[] credits = new int[n];

double totalPoints = 0, totalCredits = 0;

for (int i = 0; i < n; i++) {

System.out.print("Enter grade point for subject " + (i + 1) + ": ");

gradePoints[i] = sc.nextDouble();

System.out.print("Enter credits for subject " + (i + 1) + ": ");

credits[i] = sc.nextInt();

totalPoints += gradePoints[i] * credits[i];

totalCredits += credits[i];

double sgpa = totalPoints / totalCredits;

double cgpa;

// Apply different formula based on university


if (uni.contains("pune")) {

cgpa = sgpa;

} else if (uni.contains("mumbai")) {

cgpa = sgpa * 0.95;

} else if (uni.contains("delhi")) {

cgpa = (sgpa - 0.5);

} else {

cgpa = sgpa; // default

System.out.printf("SGPA: %.2f\n", sgpa);

System.out.printf("CGPA: %.2f\n", cgpa);

UML Diagram:

-------------

Class: Main

+ main(String[]): void

Data Dictionary:

----------------

- gradePoints: double[] - stores grade points per subject

- credits: int[] - stores credits for each subject

- sgpa: double - calculated SGPA

- cgpa: double - calculated CGPA depending on university


Conclusion:

-----------

This project offers a flexible approach to SGPA/CGPA calculation based on university-specific rules.

It can be enhanced with GUI (Swing) and database support.

You might also like