The Grade Calculator App is an Android application designed to help students manage and calculate their grades across different courses. Users can add courses, input grades for various categories, and calculate their overall weighted grades. Additionally, the app allows users to override calculated grades, set base GPA values, and calculate their cumulative GPA.
- Course Management: Add, edit, and delete courses.
- Grade Calculation: Input grades for course categories, and the app calculates the total weighted grade and letter grade.
- GPA Calculation: The app calculates the cumulative GPA based on entered course grades.
- Base GPA and Credit Hours: Set a base GPA and credit hours to be used as a starting point for GPA calculations.
The app follows a MVVM (Model-View-ViewModel) architecture pattern, which helps in separating concerns and makes the codebase easier to manage and test.
-
Model: The
Model
layer consists of the data-related components, including:- Entities: Classes like
Course
andGradeDetail
that represent the data models. - Database: The Room database is used for persistent storage, with
CourseDatabase
,CourseDAO
, andConverters
managing data access and conversion.
- Entities: Classes like
-
View: The
View
layer consists of the UI components:- Fragments: UI screens are primarily built using fragments, including
NavHomeFragment
,AddGradeFragment
, andDeleteFragment
. These fragments are responsible for displaying the data and handling user interactions. - Adapters: RecyclerView adapters, such as
CourseAdapter
andGradesAdapter
, are used to bind data to RecyclerViews for list displays.
- Fragments: UI screens are primarily built using fragments, including
-
ViewModel: The
ViewModel
layer provides a bridge between the View and the Model:- CourseViewModel: Manages UI-related data in a lifecycle-conscious way and allows the fragments to communicate with the data layer.
Before you begin, ensure you have the following prerequisites:
- Android Studio: Version 4.0 or higher
- Java Development Kit (JDK): Version 17 or higher
- Gradle: Built-in with Android Studio, no separate installation required
- Android Device or Emulator: Running Android 5.0 (Lollipop) or higher
To install and run the project locally:
-
Clone the repository:
git clone https://github.com/your-username/grade-calculator-app.git cd grade-calculator-app
-
Open the project
- Open the project in Android Studio
-
Build the project:
- Let Android Studio sync and build the project. Ensure you have all necessary dependencies installed.
-
Run the app:
- Connect an Android device or use an emulator.
- Click the "Run" button in Android Studio to build and deploy the app.
- Adding Courses: On the home screen, you can add a new course by entering the course name and credit hours.
- Managing Grades: Click on a course to add or edit grades for different categories (e.g., assignments, exams).
- Calculating GPA: The app automatically calculates the GPA based on the grades entered and displays it on the home screen.
- Customizing Grades: Use the settings to set base GPA values or override letter grades as needed.
If you'd like to contribute to this project:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.