Other Programming & Computer Science Answers

Questions: 1 727

Answers by our Experts: 1 357

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Explain term “context switch” as used in multiprogramming and multi-tasking OSs and state its benefit


Consider a scenario where branches of a Bank are situated in multiple cities and when a user

enters his ATM card in an ATM machine and if a malicious user enters a duplicate ATM card in other branch of the Bank then draw the deadlock conditions and how to avoid deadlock in these conditions in this scenario. Also draw the state transition diagram and threads in this scenario.   


Consider a scenario where branches of a Bank are situated in multiple cities and when a user

enters his ATM card in an ATM machine and if a malicious user enters a duplicate ATM card in other branch of the Bank then draw the deadlock conditions and how to avoid deadlock in these conditions in this scenario. Also draw the state transition diagram and threads in this scenario.    ​ 



YWrite a class LocalPhone that contains an attribute phone to store local phone number. The class contains member functions to input and display phone number. Write a child class NatPhone for national phone number that inherits LocPhone class. It additionally contains an attribute to store city code. It also contains member functions to input and display the city code. Write another class intPhone for international phone number that inherits NatPhone Class. It additionally contains an attribute to store country code. It also contains member functions to input and show the country code.


Write a class array that contains an array of integers as data member. The class contains the following member functions: (Marks 8)

• A constructor that initializes the array element to -20.

• Input function to input the values in array.

• Show function to display the values of the array.

• Overload == operator to compare the values of 2 objects. The overloaded function return 1 if all values of both objects are same and return 0 if not same.



Write a class template that inputs the index of the array and displays the value in the specified index.


When does ubuntu stop being ubuntu and becomes personal gain and marginalize others?


Given the number of rows N,write a program to print the hallow diamond pattern.Note:No space on the left side of the output.


                            Operating System

  1. What’re the necessary conditions of a deadlock situation that can arise if the conditions hold simultaneously in a system. 10 Marks

 

 





    Operating System


3. In a computer system, there is one CPU and two external devices IO1 and IO2, now three jobs J1, J2 and J3 are already in the main memory to be run, the priority of them is J1>J2>J3. The order and time they use the CPU and devices are as following:



J1:IO2(30ms),CPU(10ms),IO1(30ms),CPU(10ms).

J2:IO1(20ms),CPU(20ms),IO2(40ms).

J3:CPU(30ms),IO1(20ms).

Now they run at the same time and the use of resources is preemptive, please answer the following questions(you need not consider other operating times):

Calculate the time J1, J2, J3 cost from start to finish separately.

What is the CPU utilization when three jobs are finishing?

What is the IO1's utilization when three jobs are finishing?



LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS