100% Guaranteed Results


CS241 – Faculty of Computers and Artificial Intelligence Solved
$ 29.99
Category:

Description

5/5 – (1 vote)

CS241: Operating System – 1
Assignment 2: Java Synchronization
Assignment Rules
1. The Assignment is a group of 3 Maximum.
2. One team member should submit the group solution as one java file containing the required java classes and labeled by the team ids and group. e.g. Assignment_2 _201983834_201938838_G1_G1.java
4. Team Members MUST be within the same group, Members from different groups is not allowed
5. Cheating could lead to NEGATIVE SIX.
Problem Definition

The following rules should be applied:
➔ The Wi-Fi number of connected devices is initially empty.
➔ If a client is logged in (print a message that a client has logged in) and if it can be served
➔ (means that it can reach the internet), then the client should perform the following activities:
◆ Connect
◆ Perform online activity
◆ Log out
➔ Note: these actions will be represented by printed messages, such that there is a random
➔ waiting time between the printed messages when a client connects, do some online ➔ activities and logged out.
➔ If a client arrives and all connections are occupied, it must wait until one of the currently ➔ available clients finish his service and leave.
➔ After a client finishes his service, he leave and one of the waiting clients (if exist) will ➔ connect to the internet.
Solution Design
You program must contain the following classes:
1. Router Class: that contains a list of connections and methods to occupy a connection and release a connection.
2. Semaphore Class: as given the synchronization lab.
4. Network Class: this class contains the main method in which the user is asked for two inputs:
● N: max number of connections a router can accept ● TC: total number of devices that wish to connect).
● TC lines that contain: name of each device, and its type
Program Output
You will print the output logs in a file, which simulates the execution order of the devices threads and the printed messages of each device
NOTE THAT: This is just an example not the only scenario that can be applied.
Sample Input
What is the number of WI-FI Connections?
2 What is the number of devices Clients want to connect?
4
C1 mobile
C2 tablet
C3 pc
C4 pc
Sample Output
– (C1)(mobile)arrived- (C2)(tablet)arrived
– Connection 1: C1 Occupied- Connection 2: C2 Occupied
– C4(pc) arrived and waiting
– C3(pc)arrived and waiting- Connection 1: C1 login
– Connection 1: C1 performs online activity- Connection 2: C2 login
– Connection 2: C2 performs online activity
– Connection 1: C1 Logged out
– Connection 1 : C4 Occupied- Connection 1 : C4 log in
– Connection 1 : C4 performs online activity
– Connection 2: C2 Logged out- Connection 2: C3 Occupied
Grading Criteria
Router Class 10
Semaphore Class 5
Device Class 10
Network Class 10
Output Valid Order (Code Run Properly) 20
GUI – Bonus (That shows the behavior of connections when occupied or released by a particular device) 10

Reviews

There are no reviews yet.

Be the first to review “CS241 – Faculty of Computers and Artificial Intelligence Solved”

Your email address will not be published. Required fields are marked *

Related products