0% found this document useful (0 votes)
38 views

CSE215 Assignment-1

Uploaded by

Tamanna Adiba
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

CSE215 Assignment-1

Uploaded by

Tamanna Adiba
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

CSE 215 Assignment-1

Sec: 5, 6 Faculty: SfR1


Marks: 100 Deadline:

Submission Rules:
Submit the required .java files and a PDF with your answers to theoretical questions.
Submit before the deadline to avoid penalties.

Background
You are required to implement a Class Management System that supports students,
teachers, and teaching assistants. The program will allow students to enroll in courses,
teachers to manage students in their courses, and teaching assistants to view course
information and make announcements. You must design the system using Object-
Oriented Programming (OOP) principles.

(Note: You cannot use any other JAVA library classes except Array, ArrayList, Scanner
and Date.)

1. Design a UML Diagram


Create a UML diagram to represent the classes and relationships for the following:
- Classes: User, Student, Teacher, TA, Course, Section, etc.
- Implement inheritance where appropriate (e.g., Student, Teacher, and TA inherit from
User).
- Include relationships for course assignments and enrollment.

2. Java Implementation
Develop a Java program with the following specifications:

● System Setup:

Create a Session class to handle data management for users and courses. Use singleton
pattern to ensure only one session is active at a time.

● Class Structure:
- Implement the classes from the UML diagram.
- Use interfaces to define common actions across different roles. For instance, all user
types should implement an Action interface with a method handleActions().

● Role-Specific Functionalities:

Student: Can add and drop courses. The system should prevent adding a course if a
schedule conflict exists. Show the enrolled course list.
Teacher: Can view the list of sections they teach and manage students (add or remove).
TA: Can view course details and make announcements but cannot manage enrollments.
TA’s should be able to make announcements related to the courses they assist with. Each
announcement should include the course name, the message, and the date.Students should
be able to view announcements for the courses they are enrolled in.

● Course and Section Handling:

- Ensure that students cannot enroll in multiple sections of the same course.
- Limit the number of students in each section to 5.
- Implement error handling for cases like duplicate enrollments, invalid course IDs, and
authentication failures.

● Use of OOP Concepts:

- Use inheritance for the User subclasses.


- Apply abstraction for handling different user actions.
- Implement polymorphism where methods have different behaviors for different user
types (e.g., viewCourses() method).

Code Organization Guidelines:


- Separate each major feature (course management, user actions) into different methods
or classes.
- Keep the main() method concise.
- Use meaningful identifiers and comments throughout the code.
Database Example:

Email Password Student ID Student CGPA


Name

[email protected] password S1 A 3.4

[email protected] password S2 B 3.6

[email protected] password S3 C 3.2

Email Password Teacher ID Teacher Name

[email protected] password T1 A

[email protected] password T2 B

Email Password Assistant Assistant Name


ID

[email protected] password A1 A

[email protected] password A2 B

Index Course Section Timing Teacher TA


Name

1 Course A 1 A T1 A

2 Course A 2 A T2 A

3 Course A 3 B T1 B

4 Course B 1 A T1 A

5 Course C 1 B T2 A

6 Course C 2 C T1 B
Session Class Outline:

class Session {
private static Session session = null;
private ArrayList<User> userList;
private ArrayList<Course> courseList;
public Scanner inputScanner = new Scanner(System.in);

private Session() {
createDatabase();
}

public static Session getSession() {


if (session == null)
session = new Session();
return session;
}

private void createDatabase() {


// Initialize userList and courseList with data
}

public ArrayList<User> getUserList() {


return userList;
}

public ArrayList<Course> getCourseList() {


return courseList;
}
}

Execution Class Outline:

class CourseManagement {

public static void main(String[] args) {


Session session = Session.getSession();

while (true) {

System.out.print("Email:");

String email = session.inputScanner

.nextLine();

System.out.print("Password:");

String password = session.inputScanner

.nextLine();

// Authentication logic and rest

// of the program flow

Class Structure Example:

public class User {


protected String email;
protected String password;
// Add methods for login and basic information
}

public class Student extends User {


private String studentID;
private double CGPA;
// Add methods for adding and dropping courses
}

public class Course {


private String courseName;
private ArrayList<Section> sections;
// Methods for handling course-related operations
}

Input/Output Format:

Login:

Email user input

Password user input

Main Menu:

1 View Courses

2 Enroll in a Course(Student only)

3 Manage Students(Teacher Only)

4 Make Announcements(TA only)

5 Logout

> user input

Student Menu:

1 Add Course

2 View Enrolled Courses

3 Drop Course

4 Back
> User input

Teacher Menu:

1 View Courses

2 Manage Student(Remove)

3 Back

> User input

TA menu:

1 View Courses

2 Make Announcements

3 Back

> user input


3. Explain how and why the concept of inheritance, abstraction, and
polymorphism has been implemented with the program.

You might also like