How ogpulpy/cgpacalc works
Project type and purpose
• This is a simple, single-module Java command-line application whose sole purpose is to calculate a student’s Cumulative Grade Point Average (CGPA).
• Key indicators: only two source files named CGPACalculator.java (the core logic) and Main.java (the entry point), no web or GUI folders, and a minimal README.
File structure
• Top-level artifacts:
• .gitignore – standard VCS ignore file
• .idea/ & CGPA.iml – IntelliJ IDEA project metadata
• README.md – basic project description
• src/ – source code directory containing:
– Main.java
– CGPACalculator.java
• There is no persistence or external service integration evident; it’s a pure in-memory console app.
README for additional insights
• The README has no architecture details or external dependencies; it simply invites code review.
• No references to frameworks (Maven, Gradle), databases, or APIs.
a. Main components
• User (Console) – external actor
• Presentation Layer (Main.java) – handles user input/output
• Business Logic Layer (CGPACalculator.java) – performs CGPA computation
b. Relationships and interactions
1. User enters grades/credits in Console
2. Main.java reads input and calls CGPACalculator.calculate(...)
3. CGPACalculator processes data and returns a CGPA value
4. Main.java outputs the result back to the Console
c. Architectural patterns / design principles
• Layered (separation of concerns between input/output and computation)
• Single-responsibility principle: Main.java only handles I/O; CGPACalculator.java only handles calculation
d. Relevant technologies / frameworks
• Java SE (console I/O via java.util.Scanner and System.out)
• IDE metadata (IntelliJ IDEA)
• Plain javac/java for build and run (no build tool detected)