Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

The University of the West Indies, St.

Augustine
COMP 2603 Object Oriented Programming 1
Assignment 1
2020/2021 Semester 2

Due Date: February 12, 2021 at 11:50 p.m.


Lockout Date: February 14, 2021 at 11:50 p.m.

Overview:
An object-oriented application is required for a virtual meeting system that manages participants and
virtual meeting spaces. The application performs the following operations:

1. Load participant data from a data file


2. Create a new virtual room
3. Allocate participants to breakout rooms
4. Add a new participant to a breakout room
5. Display a list of all participants in a breakout room
6. Close a breakout room based on a room number
7. Open a breakout room based on a room number
8. Find a participant’s breakout room number
9. Display a list of all breakout rooms managed by the system
10. Display a list of all breakout rooms managed by the system and the participants in each room

The application consists of four domain classes: VirtualMeetingSystem, VirtualRoom, BreakoutRoom


and Participant.

UML Diagram of Domain Classes

Figure 1 shows a simplified UML diagram of the VirtualMeetingSystem, VirtualRoom, BreakoutRoom


and Participant classes along with a Runner class called VirtualRunner. One or more Participant
objects are related to one BreakoutRoom object. A VirtualRoom object manages many BreakoutRoom
objects. A VirtualMeetingSystem object invokes the services of the VirtualRoom object.

Figure 1: UML Diagram of the Domain Classes


COMP2603 Assignment 1 Page 1 of 5
VirtualMeetingSystem Class
The VirtualMeetingSystem class has the following methods. These are invoked by the VirtualRunner
class.

Method Signature Return Type Purpose

Read data from a file and loads the data into an


loadParticipantData(String filename ) void
array for allocation to breakout rooms

Creates a virtual room with the supplied name,


createVirtualRoom(String name) void
containing 5 breakout rooms
Allocates participants to the breakout rooms of a
allocateParticipants(String code ) void virtual room using a strategy determined by the
supplied code
addParticipant (String participantID, Adds a new participant to the breakout room with
boolean
int roomNumber) the supplied room number if it exists
Returns a list of the participants in the breakout
listParticipants(int roomNumber) String room with the supplied room number if found,
otherwise returns null
Opens a breakout room with the supplied room
openBreakoutRoom(int roomNumber) boolean
number if it exists

Closes a breakout room with the supplied room


closeBreakoutRoom(int roomNumber) boolean
number if it exists
Locates and returns the breakoutRoomID for the
findParticipantBreakoutRoom
String breakout room hosting the participant with the
(String participantID)
(valid) supplied ID, otherwise returns null
Returns a list of the breakout rooms managed by
listAllBreakoutRooms( ) String
the virtual room
Returns a list of all of the participants per breakout
listParticipantsInAllBreakoutRooms()
String room managed by the virtual room, otherwise
returns null

Allocation strategies and codes for the allocateParticipants(..) method

Code: C5 (Your program must handle this code)


This strategy selects participants from the data list and allocates participants to the virtual rooms in a
clusters of 5.

Code: RR (Bonus for programs that handle this code successfully in addition to RR )
This strategy selects participants from the data list and allocates participants to the virtual rooms in a
round robin fashion.

Example:
Participant IDs: 100, 200, 300, 400, 500, 600, 700, 800, 900, 999.
Virtual Room name: Workshop
BreakoutRoom IDs: Workshop1, Workshop2, Workshop3, Workshop4, Workshop5

C5 Allocations:
Workshop1: {100, 200, 300, 400, 500 }, Workshop2: {600, 700, 800, 900, 999},
Workshop3: { }, Workshop4: { }, Workshop5: { }

RR Allocations:
Workshop1: {100, 600 }, Workshop2: {200, 700}, Workshop3: {300, 800 }, Workshop4: {400, 900 },
Workshop5: {500, 999 }

COMP2603 Assignment 1 Page 2 of 5


VirtualRoom Class

The VirtualRoom class models a virtual room in the virtual meeting system. A virtual room creates and
manages up to a certain number of breakout rooms.

Attribute Type Purpose

name String The name of the virtual room

A constant that specifies the maximum number of


breakoutRoomLimit int
breakout rooms allowed for a virtual room

A list of breakout rooms managed by the virtual


breakoutRooms BreakoutRoom[ ]
room

The VirtualRoom class has the methods below.


Method Signature Return Type Purpose

VirtualRoom( String name) Constructor. Initialises the breakoutRoomLimit to 5

Overloaded constructor. Initialises the


VirtualRoom( String name, int limit)
breakoutRoomLimit to the supplied limit
Returns the total number of breakout rooms
getNumberOfBreakoutRooms( ) int
managed by the virtual room
Creates new BreakoutRoom objects that fill the list
createBreakoutRooms( ) void
of breakout rooms
Locates and returns the breakout room with the
findBreakoutRoom(int roomNumber) BreakoutRoom
supplied room number, otherwise returns null

Closes a breakout room with the supplied room


closeBreakoutRoom(int roomNumber) boolean
number if it exists

Opens a breakout room with the supplied room


openBreakoutRoom(int roomNumber) boolean
number if it exists

Returns a list of the breakout rooms managed by


listBreakoutRooms( ) String the virtual room with the virtual room name heading
the list on a separate line

listParticipantsInBreakoutRoom(int Returns a list of the participants in the breakout


roomNumber) String room with the supplied room number if found,
otherwise returns null
addParticipantToBreakoutRoom
(String participantID, int Adds a new participant to the breakout room with
boolean
roomNumber) the supplied room number if it exists

findParticipantBreakoutRoom Locates and returns the breakoutRoomID for the


(String participantID) String breakout room hosting the participant with the
(valid) supplied ID, otherwise returns null

COMP2603 Assignment 1 Page 3 of 5


BreakoutRoom Class

The BreakoutRoom class models a breakout room in the virtual meeting system. A breakout room
hosts participants. It is created by a virtual room such that the breakout room’s ID is based on the
virtual room’s name. Participants are added to the breakout room if it is open and if there is sufficient
space to accommodate new participants. Duplicate participants (based on IDs) are not allowed.

Attribute Type Purpose

Unique identifier for a breakout room in the virtual


breakoutRoomID String system formed by the combination of the virtual
room name and a unique room number
A class variable for producing unique integer values
breakoutRoomNumberCounter int
used in creating breakoutRoomID values
A constant that specifies the maximum number (10)
breakoutRoomSize int
of participants allowed in a breakout room
A list of participants who have been added to the
participants Participant[ ]
breakout room

numberOfParticipants Keeps track of the number of participants in the


int
breakout room

A flag for tracking whether the breakout room’s


open boolean
state is open or closed

The BreakoutRoom class has the methods below including accessors for the breakoutRoomID,
numberOfParticipants and open variables.

Method Signature Return Type Purpose

BreakoutRoom (String name) Constructor

Adds a new participant (no duplicates) with a valid


addParticipant( String participantID) boolean ID to the (open) breakout room if the room is not
filled and then returns true, otherwise returns false
Locates and returns a participant based on a
findParticipant( String participantID) Participant supplied (valid) ID if present in the (open) breakout
room, otherwise returns null.
Returns a list of the participants (ID and name) in
listParticipants( ) String the breakout room with the breakout room ID
heading the list on a separate line
Returns a String representation of the aggregated
toString( ) String
state of a BreakoutRoom
Closes the breakout room, clears the participant list
closeBreakoutRoom( ) void
and resets any relevant state of the breakout room

Opens the breakout room and sets the state as


openBreakoutRoom( ) void
open

Additional notes: Example of toString( ) output for the first breakout room, associated with a virtual
room called Seminar, hosting 4 participants and currently open:

Seminar1 OPEN 4

COMP2603 Assignment 1 Page 4 of 5


Participant Class

The Participant class models a participant in the virtual meeting system. Participants have the
following state attribute.

Attribute Type Purpose


Predefined identifier for a participant in the virtual
participantID String
system. These must conform to an 8 digit format

The Participant class has the methods below


Method Signature Return Type Purpose

Participant (String participantID) Constructor

Class method that validates that a non-null,


verifyID(String participantID) boolean participantID conforms to the required 8 digit
format and returns true, otherwise false.

getParticipantID( ) String Accessor for a participant’s ID


Returns a String representation of the state of a
toString( ) String Participant formatted as follows:
Participant: participantID

Submission Instructions
• Write the Java code for each class in the application using BlueJ and set up the associations
shown in Figure 1.
• Document your student ID at the top of each file within a comment block.
• Upload a zipped file of your compiled project source and class files to the myElearning course
page by the deadline. Submissions that do not compile will receive 0 marks.
• Name your zipped filed as follows: FirstName_LastName_ID_A1.zip. Marks will be deducted for
submissions that do not conform to this naming convention.
• Sign and submit the University Plagiarism declaration confirming that you are submitting your own
original work and that you have not copied or collaborated with other students.
• Early submission points can be earned if you submit before the due date. No penalties will be
applied but no early points will be earned if you submit by the lockout date.

Important Information Regarding Academic Conduct


• This is an individual assignment. You may use legitimate resources on the Internet, in books, or
from the course notes to assist (unless prohibited by a question). Copying or modifying such
content does not make it yours. Indicate on your submission any or all sources used in your
answers within comments at the end of your files.
• You must attempt this assignment by yourself without any help from others.
• You are not allowed to communicate, share or disclose any aspect of your solutions/work in any
form to anyone except for the course lecturer, markers, examiners and tutors.
• You are not allowed to assist others with this assignment.
• University plagiarism and academic misconduct policies apply fully.
• No part of your submission should be made publicly available even after the due date without
permission from the course lecturer.
• The use of Chegg.com, CourseHero.com or any tutoring or homework assistance services, online
or not, are prohibited.
• If you are faced with extenuating circumstances, contact your lecturer right away. Concessions
may be arranged on a case-by-case basis. Be honest with your claims and provide evidence
where possible.

COMP2603 Assignment 1 Page 5 of 5

You might also like