Enter your semester GPAs and credits. The app tells you the lowest GPA you can score next semester and still finish at a 9.0 CGPA, for every credit load from 16 to 27.
Features ยท Quick start ยท Architecture ยท Docs ยท Roadmap ยท Contributing
Note
Status: classic project. Built in May 2016 as a student project and restructured into MVC packages in June 2016. It is not actively maintained. The code targets Android SDK 23 and the 2016 support libraries. See Quick start for how to open it today.
On a 10-point, credit-weighted scale, the question every student eventually asks is "what do I need next semester to stay above 9?" The honest answer depends on how many credits you've already banked and how heavy the next semester is.
This app answers it for every credit load at once. It treats your grade-point surplus (or deficit) as something to amortize over the next semester's credits, the same bookkeeping as amortized analysis in algorithms. The full derivation is in docs/ALGORITHM.md.
| A swipeable eight-page pager, one card per semester, with GPA and credit fields. Input is checked for blanks and a 0โ10 GPA range before it counts. |
Every submitted semester adds an animated bar to an MPAndroidChart BarChart labelled SEM 1โฆSEM 8.
|
| Recomputed after every entry as ฮฃ(GPA ร credits) / ฮฃ credits, with a verdict line: "Go and Explore the world!" above 9, "Start Studying!" otherwise. | For next-semester loads of 16โ27 credits, the lowest GPA that keeps your CGPA at 9.0. It reads "Above 10" when that load can't get you there. |
g* = 9 + Cยท(9 โ CGPA) / n: your banked surplus or debt, spread over the next n credits. The derivation and examples are in ALGORITHM.md.
|
Model / View / Controller packages wired with greenrobot EventBus. A sticky event hands the semester list to the estimate dialog.
|
flowchart LR
GF["GPAFragment<br/>SEM 1 โฆ SEM 8"] -->|"DataUpdateEvent"| MA["MainActivity"]
MA --> CC["CalculateCGPA"]
MA --> BC["BarChart<br/>one bar per semester"]
MA -->|"sticky DataListEvent"| AD["AlertDialogFragment"]
AD --> CAG["CalculateAmortizedGPA<br/>n = 16 โฆ 27"]
CAG --> CC
AD --> AA["AmortizedAdapter<br/>RecyclerView rows"]
You enter a semester on a GPAFragment page, which posts a DataUpdateEvent through EventBus. MainActivity stores it, recomputes the CGPA, adds a bar, advances the pager, and opens AlertDialogFragment with the full list as a sticky event. The dialog builds the 16โ27-credit table. Package map, sequence diagram and lifecycle notes are in docs/ARCHITECTURE.md.
Important
The repository contains only the app/ module. There is no root settings.gradle, build.gradle or Gradle wrapper, so you need to add them before Android Studio will open the project.
Era-faithful setup (2016 toolchain): Android Studio 2.x, JDK 8, SDK Platform 23, Build Tools 23.0.3 and the Android Support Repository. Use a device or emulator on API 22+.
-
Clone
git clone https://github.com/abhinav-adtechs/CGPAAmortizedAnalysis.git cd CGPAAmortizedAnalysis -
Add the two missing root files. These are period-appropriate versions; AGP 2.1.x was current in May 2016:
settings.gradleinclude ':app'build.gradlebuildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' } } allprojects { repositories { jcenter() } } -
Open the folder in Android Studio and accept its offer to set up the Gradle wrapper. Then run the
appconfiguration. -
Try the built-in sample. Enter the four semesters that
AlertFragmenthard-codes, one per page, tapping Add GPA each time:Page GPA Credits SEMESTER 1 9.4 24 SEMESTER 2 9.3 26 SEMESTER 3 9.2 24 SEMESTER 4 9.0 24 The last dialog should list a minimum GPA of about 7.61 for 16 credits, rising to about 8.18 for 27. The verdict line should show a CGPA of about 9.23. ALGORITHM.md ยง6 works through the numbers.
Tip
Using a current Android Studio? jcenter has been retired and the 2016 Gradle plugin won't run on modern JDKs. The least painful route is a fresh Empty Views Activity project (Java, package abhinav.hackdev.co.amortizedanalysis, min SDK 22). Copy app/src/main/java and app/src/main/res into it and add the dependencies with modern coordinates:
implementationinstead ofcompile- AndroidX (
androidx.appcompat:appcompat,androidx.recyclerview:recyclerview, andandroidx.legacy:legacy-support-v13for the framework-fragmentFragmentPagerAdapter), then update theandroid.support.*imports to theirandroidx.*equivalents org.greenrobot:eventbusfrom Maven Central- MPAndroidChart
v2.2.4from JitPack (the v3 API differs)
If ink-page-indicator:1.1.1 no longer resolves, remove the indicator from activity_main.xml and MainActivity. It is cosmetic.
No environment variables or settings screen. The behaviour is fixed by these constants:
| What | Value | Where |
|---|---|---|
| Target CGPA | 9 |
Model/Entities/CalculateAmortizedGPA.java L30, dialog title in res/layout/fragment_alert_amortized.xml |
| Next-semester credit loads | 16โ27 | View/Fragments/AlertDialogFragment.java L80 |
| Number of semesters | 8 | Controller/CustomAdapter.java L28, chart labels in MainActivity.java L94โ96 |
| Valid GPA range | 0โ10 | View/Fragments/GPAFragment.java L68 |
| Verdict threshold | CGPA > 9 | View/Activities/MainActivity.java L158 |
(Paths relative to app/src/main/java/abhinav/hackdev/co/amortizedanalysis/ unless they start with res/.)
CGPAAmortizedAnalysis/
โโโ app/
โ โโโ build.gradle # SDK 23, minSdk 22, dependencies
โ โโโ src/main/
โ โโโ AndroidManifest.xml
โ โโโ java/abhinav/hackdev/co/amortizedanalysis/
โ โ โโโ Controller/
โ โ โ โโโ CustomAdapter.java # 8-page semester pager adapter
โ โ โ โโโ AmortizedAdapter.java # minimum-GPA table rows ("Above 10" clamp)
โ โ โโโ Model/
โ โ โ โโโ Entities/
โ โ โ โ โโโ CalculateCGPA.java # โ
credit-weighted CGPA
โ โ โ โ โโโ CalculateAmortizedGPA.java # โ
minimum GPA for next semester
โ โ โ โ โโโ GPAData.java ยท EstimatedList.java ยท GPAList.java
โ โ โ โโโ EventBusEvents/
โ โ โ โโโ DataUpdateEvent.java ยท DataListEvent.java
โ โ โโโ View/
โ โ โโโ Activities/MainActivity.java # pager, bar chart, verdict
โ โ โโโ Fragments/GPAFragment.java # one semester's input card
โ โ โโโ Fragments/AlertDialogFragment.java # estimate dialog
โ โ โโโ Fragments/AlertFragment.java # demo activity with sample data
โ โ โโโ CustomViews/CustomViewPager.java
โ โโโ res/layout/ # activity_main, fragment_gpa, fragment_alert_amortized, list_item
โโโ docs/
โโโ ALGORITHM.md # derivation, amortized view, worked examples
โโโ ARCHITECTURE.md # packages, event flow, build config
| Document | What's inside |
|---|---|
docs/ALGORITHM.md |
CGPA and minimum-GPA formulas with line references, the aggregate/potential-method view of "amortized", reachability bound, worked examples, edge cases |
docs/ARCHITECTURE.md |
MVC package map, EventBus sequence diagram, lifecycle notes, build configuration |
CHANGELOG.md |
Release history derived from the commit log |
- Fix double counting when a semester is submitted twice
- Fix the crash when a later semester is entered before earlier ones
- Validate credits (> 0) so the CGPA can't become
NaN - Make the target CGPA configurable instead of a hard-coded 9
- Spread the deficit over several remaining semesters when one isn't enough ("Above 10")
- Unit tests for
CalculateCGPAandCalculateAmortizedGPA - Add root Gradle files and migrate the build to current AGP/AndroidX
- Persist entered semesters across rotation and restarts
Issues and PRs are welcome, especially anything on the roadmap. See CONTRIBUTING.md for setup, commit conventions and the PR checklist.
MIT ยฉ 2016โ2026 Abhinav Das. See LICENSE.
Built by Abhinav Das
If this project helped you, consider giving it a โญ