This project allows users to convert their CGPA (Cumulative Grade Point Average) to a percentage using Pokhara University's CGPA to Percentage scale.
- Converts CGPA (ranging from 2.00 to 4.00) to percentage.
- Displays corresponding grade and honor points.
- Handles errors like invalid CGPA input or CGPA outside the allowed range.
- Designed using modern UI principles for a smooth user experience.
- Frontend: React, TypeScript
- State Management: React hooks (
useState
) - UI Library: Lucide React (for icons)
/src
├── /models
│ └── cgpaModel.ts // Business logic for CGPA to percentage conversion
├── /controllers
│ └── cgpaController.ts // Controller that handles logic between Model and View
└── App.tsx // React component (View)
- Model (
cgpaModel.ts
): Contains the business logic to convert CGPA to percentage and determine the grade. - Controller (
cgpaController.ts
): Manages the interaction between the view and the model (handling CGPA input validation). - App.tsx: The React component that serves as the view to interact with the user.
Clone the repository:
git clone https://github.com/nabinkdl/CGPA_PokharaUni
cd cgpa_PokharaUni
Install dependencies:
npm install
Run the app:
npm start
Your app will be running at http://localhost:3000.
- Enter your CGPA (between 2.00 and 4.00).
- Click on the "Calculate Percentage" button to see the corresponding percentage, grade, and honor points.
- Error messages will be shown if you enter an invalid CGPA or a CGPA outside the accepted range.
For a CGPA of 3.5, the app will show:
- Percentage: 85.00%
- Grade: A-
- Honor Points: 3.7
This project is licensed under the MIT License - see the LICENSE file for details.