Write a shell script program with a menu in linux that does


Task 1 -

a) Compare multiprogramming and multitasking. You should define what these multiprocessing approaches are, and identify their similarities and differences. You might consider including diagrams to support your findings. Write no more than 500 words.

b) Discuss about microkernels and how it compares with monolithic kernels. Use suitable diagrams to illustrate the differences between them.

Task 2 -

a) Write a shell script program with a menu in Linux that does the following:

1. List the current directory

2. Call a function and fork a child to greet "Greetings". Display both parent ID and child ID

3. Generate a child process (with PID displayed) that calls a sleep function to print Hello to the screen every 5 seconds

4. Terminate/Kill the process in part 3)

5. Quit

Example:  The program will display the contents of the current directory when the user keys in 1.  The program must allow the user to quit when he keys in 5.

Task 3 -

a) Implement in code to calculate the average wait time and the average turnaround time for a Shortest Job First algorithm for 3 to 6 processes. Assume all processes arrive at T=0.

b) Each of you will be given a different scenario to do this part. Draw the Gantt chart of the processes using the Round Robin Algorithm (RR)

Calculate the average wait time and average turnaround time with RR with quantum of 3.

Task 4 -

a) Modify the given TCP server (in C code) to be a "Fun Bulletin Board Server (FBBS)". The FBBS will connect only on a fixed port. The fixed port will be based on the last 5 digits of your student number. FBBS will be able to reply based on the option entered. You will work on the code provided (C programming language)

a. Upon successful connection to FBBS, the client will be greeted with the menu as shown "This is the Fun Bulletin Board Server."

"1. Quote of the Day"

"2. News

"Enter a number:

b. The following table shows the corresponding for a  Type.

Option entered

 

One of the random responses to be displayed.

1

Part of the secret of success in life is to eat what you like and let the food fight it out inside.

- Mark Twain

 

In the right light, at the right time, everything is extraordinary.

- Aaron Rose

 

I generally avoid temptation unless I can't resist it.

- Mae West

2

World's fastest finger-snapping guy plays along amazingly to song beats

 

Next Prime Minister will not cause 'huge discontinuity': Chan Chun Sing

 

Man who stole $27,800 from father and employer jailed

 

Example 1: When user keys in "1" into the client terminal (Connected to the server), the server may reply with: "In the right light, at the right time, everything is extraordinary. - Aaron Rose" or any of the other 2 responses provided above.

Example 2: When user keys in "2", the reply may be "Next Prime Minister will not cause 'huge discontinuity': Chan Chun Sing" or any of the other 2 responses.

Any invalid type keyed in would result in a reply: "Please choose a valid option."

This part will constitute a total of 4 marks for the Task part 4.

Task 5 -

a) Activity 2 of Lab20:

1) The code below (a2q5.cc) shows a score tracking system. After entering the students' scores, the system will display the total score and the average score. However if the user does not enter any scores, there will be a runtime error in the program.

Modify the code to add (attached file) exception handling. The exception handling should take care of the data types as well as the number of students.

2) You can rewrite the whole code in python or java and apply the necessary exception(s) required to complete the answer.

Attachment:- Assignment File.rar

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a shell script program with a menu in linux that does
Reference No:- TGS02629903

Expected delivery within 24 Hours