{"id":24264677,"url":"https://github.com/awais-124/oop-practice-problem","last_synced_at":"2026-06-08T05:32:10.169Z","repository":{"id":270515879,"uuid":"910384912","full_name":"awais-124/oop-practice-problem","owner":"awais-124","description":"Program to practice OOP concepts","archived":false,"fork":false,"pushed_at":"2024-12-31T20:27:13.000Z","size":254,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T00:46:24.874Z","etag":null,"topics":["cpp","inheritance","java","oop","problem-solving"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awais-124.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-31T06:12:48.000Z","updated_at":"2025-02-02T19:37:15.000Z","dependencies_parsed_at":"2024-12-31T21:23:45.070Z","dependency_job_id":"f106e921-4583-4d77-bb0c-c921a79fdbbc","html_url":"https://github.com/awais-124/oop-practice-problem","commit_stats":null,"previous_names":["awais-124/oop-practice-problem"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/awais-124/oop-practice-problem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awais-124%2Foop-practice-problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awais-124%2Foop-practice-problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awais-124%2Foop-practice-problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awais-124%2Foop-practice-problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awais-124","download_url":"https://codeload.github.com/awais-124/oop-practice-problem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awais-124%2Foop-practice-problem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34050224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","inheritance","java","oop","problem-solving"],"created_at":"2025-01-15T09:40:44.501Z","updated_at":"2026-06-08T05:32:10.152Z","avatar_url":"https://github.com/awais-124.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# University Grade Report System\n\n## Overview\nThis document details the classes, their properties, methods, and relationships required to implement a Java program for generating grade reports for students at CUST university. The program reads data from a file, processes it, and generates appropriate grade reports based on whether students have paid their tuition fees.\n\n## Classes and Their Relationships\n\n### 1. `CourseType`\nRepresents a course with its details.\n\n#### Properties:\n- `private String courseName`\n- `private String courseNumber`\n- `private int courseCredits`\n\n#### Methods:\n- **Constructor**:\n  - `public CourseType()`\n  - `public CourseType(String courseName, String courseNumber, int courseCredits)`\n- **Setters**:\n  - `public void setCourseInfo(String courseName, String courseNumber, int courseCredits)`\n- **Getters**:\n  - `public String getCourseName()`\n  - `public String getCourseNumber()`\n  - `public int getCourseCredits()`\n- **Print Method**:\n  - `public void print(PrintWriter outputHandler)`\n\n---\n\n### 2. `PersonType`\nRepresents a person with a first name and last name.\n\n#### Properties:\n- `protected String firstName`\n- `protected String lastName`\n\n#### Methods:\n- **Constructor**:\n  - `public PersonType()`\n  - `public PersonType(String firstName, String lastName)`\n- **Setters**:\n  - `public void setName(String firstName, String lastName)`\n- **Getters**:\n  - `public String getFirstName()`\n  - `public String getLastName()`\n  - `public String getFullName()`\n\n---\n\n### 3. `StudentType` (extends `PersonType`)\nRepresents a student with additional details like student ID, courses enrolled, grades, and tuition fee status.\n\n#### Properties:\n- `private final int MAX_COURSES = 6`\n- `private CourseType[] coursesEnrolled = new CourseType[MAX_COURSES]`\n- `private char[] grades = new char[MAX_COURSES]`\n- `private int studentID`\n- `private int numberOfCourses`\n- `private boolean isTuitionFeePaid`\n\n#### Methods:\n- **Constructor**:\n  - `public StudentType()`\n- **Setters**:\n  - `public void setInfo(String firstName, String lastName, int studentID, int numberOfCourses, boolean isTuitionFeePaid, CourseType[] coursesEnrolled, char[] grades)`\n- **Getters**:\n  - `public int getHoursEnrolled()`\n  - `public double getGPA()`\n  - `public double billingAmount(int feePerCreditHour)`\n- **Print Methods**:\n  - `public void print(PrintWriter outputHandler)`\n  - `public void displayInConsole()`\n- **Private Methods**:\n  - `private void sortCourses()`\n\n---\n\n## Main Program\n\n### Main Class: `Main`\nHandles reading data from the input file, processing it, and generating the output.\n\n#### Properties:\n- `final int MAX_NO_OF_STUDENTS = 10`\n- `StudentType[] studentList = new StudentType[MAX_NO_OF_STUDENTS]`\n- `int noOfStudents = 0`\n- `int tuitionRate = 0`\n\n#### Methods:\n- **Main Method**:\n  - `public static void main(String[] args)`\n    - Reads the number of students and tuition rate from the input file.\n    - Reads and processes each student's data.\n    - Generates and prints grade reports for each student.\n\n### Function to Get Student Data\nThis function reads the student data from the input file and loads it into the `studentList` array.\n\n#### Details:\n- **Parameters**:\n  - A parameter to access the array `studentList`.\n  - A parameter to know the number of students registered.\n- **Steps**:\n  - For each student in the university, get the first name, last name, student ID, and tuition payment status.\n  - Get the number of courses the student is taking.\n  - For each course, get the course name, course number, credit hours, and grade.\n  - Load the course information into a `CourseType` object.\n  - Load the data into a `StudentType` object.\n\n---\n\n## Detailed Working of Important Functions\n\n### 1. `setCourseInfo` in `CourseType`\nSets the values of the private member variables according to the values of the parameters.\n\n### 2. `print` in `CourseType`\nPrints the course information:\n- Prints the course number.\n- Prints the course name.\n- Prints the credit hours.\n\n### 3. `setInfo` in `StudentType`\nInitializes the private member variables according to the incoming parameters and then calls the `sortCourses` method to sort the array `coursesEnrolled` by course number.\n\n### 4. `sortCourses` in `StudentType`\nSorts the array `coursesEnrolled` by course number using the selection sort algorithm.\n\n### 5. `getHoursEnrolled` in `StudentType`\nCalculates and returns the total credit hours that a student is taking by adding the credit hours of each course in which the student is enrolled.\n\n### 6. `getGPA` in `StudentType`\nCalculates a student's GPA:\n- Finds the equivalent points for each grade.\n- Adds the points.\n- Divides the sum by the total credit hours the student is taking.\n\n### 7. `billingAmount` in `StudentType`\nCalculates and returns the amount due based on the number of credit hours enrolled if a student has not paid the tuition.\n\n### 8. `print` in `StudentType`\nPrints the grade report:\n- Outputs the student's name.\n- Outputs the student's ID.\n- Outputs the number of courses in which the student is enrolled.\n- Outputs the heading:\n  - ```Course No  Course Name    Credits    Grade```\n\n- Prints each course's information.\n- If `isTuitionPaid` is true, outputs the grade.\n- Otherwise, outputs three stars.\n- Prints the total credit hours.\n- If `isTuitionPaid` is true, outputs the GPA.\n- Otherwise, outputs the billing amount and a message about withholding the grades.\n\n---\n\n## Sample Input Data\n```txt\n3 345\nLisa Miller 890238 Y 4\nMathematics MTH345 4 A\nPhysics PHY357 3 B\nComputerSci CSC478 3 B\nHistory HIS356 3 A\n\nBill Wilton 798324 N 5\nEnglish ENG378 3 B\nPhilosophy PHL534 3 A\nChemistry CHM256 4 C\nBiology BIO234 4 A\nMathematics MTH346 3 C\n\nDandy Goat 746333 Y 6\nHistory HIS101 3 A\nEnglish ENG328 3 B\nMathematics MTH137 3 A\nChemistry CHM348 4 B\nComputerSci CSC201 3 B\nBusiness BUS128 3 C\n```\n\nThis document outlines the structure and functionality of the Java program to generate grade reports for students based on their tuition status and grades. The classes and methods described should be implemented to achieve the desired functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawais-124%2Foop-practice-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawais-124%2Foop-practice-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawais-124%2Foop-practice-problem/lists"}