Ws 4
Ws 4
Description
In this workshop, you will create a Java application to manage students and their course
enrollments, using object-oriented programming principles:
- Use inheritance and polymorphism to model different student types.
- Allow users to input a dynamic list of courses.
- Track which course each student is enrolled in using a course code reference.
- Use collections to manage data.
- Generate a report that displays all students grouped by course, showing pass/fail status
and letter grades.
Requirements
1. Create a new Java project named Workshop4. The main class should be
workshop4.Workshop4
Class Course
Course
- code: String
- name: String
+ Course(code, name)
+ getCode(): String
+ getName(): String
+ setCode(String code): void
+ setName(String name): void
Base Class: Student
Student
-name: String
-age: int
-code: String
-grade: int
+Student(name, age, code, grade)
+getName(): String
+getAge(): int
+getCode(): String
+getGrade(): int
+getCourse(): Course
+setName(name: String): void
+setAge(age: int): void
+setCode(code: String): void
+setGrade(grade: int): void
+setCourse(course: Course): void
+isValidCode(): boolean
+isPassed(): boolean
+getLetterGrade(): String
UndergraduateStudent
Behaviors
Sample Output
Enter number of courses: 2
Course 1 code: CS101
Course 1 name: Intro to Programming
Course 2 code: CS202
Course 2 name: Data Structures
Submission Instructions
- Zip your entire project folder (with src and any .java files)
- File name format: StudentID_Name_Workshop4.zip
- Submit it to your LMS before the deadline