# πŸ§™β€β™‚οΈ Workshop: Hogwarts School System - A Magical OOP Adventure ## Welcome, Young Wizard! > *"The sorting hat has placed you in Gryffindor... No, wait! It placed you in the **Java Development** house!"* Welcome to the **Hogwarts School System** workshop! This magical journey will help you master the fundamentals of **Object-Oriented Programming (OOP)** through a fun, wizard-themed project. --- ## 🎯 Workshop Objectives By completing this workshop, you will learn and practice: | Concept | How it's used in this project | |---------|-------------------------------| | **Encapsulation** | Private fields with public getters/setters | | **Inheritance** | `Student` and `Teacher` extend `User` | | **Polymorphism** | Different user types with same methods | | **Abstraction** | Abstract `User` class with common behavior | | **Lists & Collections** | Managing students, teachers, and courses with `ArrayList` | | **Input Validation** | Validating usernames and passwords | | **ID-based Selection** | Finding courses by unique ID instead of name | --- ## 🏰 Storyline *Professor Dumbledore has asked you to help modernize Hogwarts! The old parchment-based course enrollment system is a disaster. Students keep signing up for the wrong classes, and Professor Snape is furious because his Potions class is full of first-year students who can't tell a bezoar from a newt's eye.* *Your mission: Build a digital School Management System that allows:* - *Students to view available courses and enroll using magical Course IDs* - *Teachers to create new courses and manage their classes* - *Everyone to log in securely (even Filch needs to check who's where)* --- ## πŸ“š Class Hierarchy Diagram β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ User β”‚ β”‚ (Abstract) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”‚ Student β”‚ β”‚ Teacher β”‚ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”‚enrolled β”‚ β”‚ myCourses β”‚ β”‚ Courses β”‚ β”‚ (List) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Course β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ - id (static) β”‚ β”‚ - name β”‚ β”‚ - teacher β”‚ β”‚ - students β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ contains β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ SchoolSystem β”‚ β”‚ (Service) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ --- --- ## πŸ“‹ Complete TODO List ### πŸ”§ Student.java (3 TODOs) | # | Method | Description | |---|--------|-------------| | 1 | `enrollInCourse(Course course)` | Register student in a course | | 2 | `showMyCourses()` | Display all enrolled courses | | 3 | `getEnrolledCourses()` | Return list of enrolled courses | ### πŸ”§ SchoolSystem.java (5 TODOs) | # | Method | Description | |---|--------|-------------| | 4 | `registerStudent(String username, String password)` | Register new student | | 5 | `loginStudent(String username, String password)` | Student login | | 6 | `findStudent(String username)` | Find student by username (private) | | 7 | `addCourseToSystem(String courseName)` | Add new course to system | | 8 | `findCourseById(int id)` | Find course by ID | ### πŸ”§ Main.java (4 TODOs) | # | Location | Description | |---|----------|-------------| | 9 | `registerMenu()` - case 1 | Student registration | | 10 | `loginMenu()` - case 1 | Student login | | 11 | `studentMenu()` - case 3 | Show my courses | | 12 | `enrollInCourse(Student student)` | Enroll logic | ### πŸ“Š Summary | File | TODO Count | |------|------------| | Student.java | 3 | | SchoolSystem.java | 5 | | Main.java | 4 | | **Total** | **12** | --- ## ℹ️ Note > This exercise is for practice only and has no bouns. > Students can complete it in class with TA assistance. **Good luck, young wizard!** ✨