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.