Write a shell script program with a menu in linux

Assignment Help Programming Languages
Reference no: EM131834398

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

Reference no: EM131834398

Questions Cloud

Random variable obeying a normal probability : Suppose that the load on an airplane wing is a random variable X obeying a normal probability law with mean 1000 and variance 14,400, whereas
Identify the major business problems the project team find : Speculate on the prominent reasons General Dynamics selected the agile framework they did to use in this project.
Evaluate views of john searle and rene descartes on dualism : Compare, contrast, and evaluate the views of John Searle and René Descartes on dualism. Evaluate the views of George Berkeley and Thomas Hobbes on the mind.
Find and sketch the probability density function : In exercises let X1 and X2 be independently and uniformly distributed over the intervals 0 to 1.
Write a shell script program with a menu in linux : Write a shell script program with a menu in Linux that does the following: List the current directory. Discuss about microkernels
Uniformly distributed over the intervals : In exercises let X1 and X2 be independently and uniformly distributed over the intervals 0 to 1.
Uniformly distributed over the intervals : In exercises let X1 and X2 be independently and uniformly distributed over the intervals 0 to 1.
Determine your native conflict response behavior : Provide one (1) example that supports your conclusion. Note: This is a safe environment for everyone to share his / her personal experience.
Independent random variables : Let X1, X2, and X3 be independent random variables, each exponentially distributed with parameter A = ½.

Reviews

len1834398

1/27/2018 5:46:43 AM

Formatting & Referencing: Harvard. Here is the question. This assignment is having multiple question and programming language for them each question python, c ++ and linux bin bash shell script. if you have any doubt please let me know. Dear, For task 3, B. teacher has given a scenario as below. You can rewrite the whole code in python or java and apply the necessary exception(s) required to complete the answer.

Write a Review

Programming Languages Questions & Answers

  Logic for a program that allows a user to enter 15 numbers

Design the logic for a program that allows a user to enter 15 numbers, then displays each number and its difference from the numeric average of the numbers entered

  Differentiating client-side and server-side scripting

Understanding difference between client-side and server-side scripting is significant when developing interactive sites. When and why should you use client-side versus server-side scripting?

  Program asks for number of shares-whole dollar portion price

Program asks for number of shares held, whole dollar portion of price, and fraction portion. fraction portion is to be input as two integer values, one for numerator and one for the denominator.

  Design a tester class called amusementparktester

Develop class AmusementPark that keeps track of tickets and gift shop inventory. The AmusementPark uses two ArrayLists to store Ticket and Merchandise objects.

  Create an html5 application using the guidelines

Produce an HTML5 page divided vertically into two divs (left and right).

  Insert a html file into an html document

How do you insert a link to the file goodstuff.html in an HTML document? The browser should go to the HTML document goodstuff.html.

  Determine the output of the given program what will happen

question what is the output of the following program?class exception2 public static void mainstring args

  Amend the constructor so that it has an additional parameter

Define an accessor getYears(), which returns the number of years in teaching. Declare a field to store the member's id number. Amend the constructor so that it has an additional parameter of an appropriate type which it then uses to initialise the id..

  Creating a month-by-month simulation

You are creating a month-by-month simulation of a grain-growing operation - you will create a month-by-month simulation in which each agent

  Function to compute the average of numbers

Function will then compute the average of numbers, total of all of the numbers added together, and new array of numbers.

  Problematic programming situation

Suggest one example of a problematic programming situation or scenario that the use or implementation of a loop structure could resolve. Justify your response.

  Design a class named customerrecord that holds a customer

design a class named customerrecord that holds a customer number name and address. include methods to set the values

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd