Lab Assignment 1 Solution

$35.00 $24.00

  Instructions:   All the assignments should be completed and uploaded by 5 pm. Marks will be deducted for the submissions made after 5 pm.   Markings will be based on the correctness and soundness of the outputs. Marks will be deducted in case of plagiarism. 3.  Proper indentation and appropriate comments (if necessary) are…

You’ll get a: . zip file solution

 

 
Categorys:

Description

5/5 – (2 votes)

 

Instructions:

 

  1. All the assignments should be completed and uploaded by 5 pm. Marks will be deducted for the submissions made after 5 pm.

 

  1. Markings will be based on the correctness and soundness of the outputs. Marks will be deducted in case of plagiarism.
3.  Proper indentation and appropriate comments (if necessary) are mandatory.  [2+2
marks]  
  1. You should zip all the required files and name the zip file as  roll_no .zip , eg.

1501cs11.zip.

 

  1. Upload your assignment ( the zip file ) in the following link: https://www.dropbox.com/request/uulSQFgm4ftxGGrT4J7u

 

Questions:

 

  1. Collect the following basic information about your machine using the /proc file system and answer the following questions:

 

  1. How many CPU and cores does the machine have?

 

  1. What is the frequency of each CPU ?

 

  1. How much memory does your system have?

 

  1. How much of it is free and available? What is the difference between them?

 

  1. What is total number of user-level processes in the system? [5 marks]

 

  1. A text file txt consists of the following passage:

“An operating system (OS) is system software that manages hardware, software resources, provides common services for computer programs. Every general-purpose computer must have operating system to run other applications.”

 

 

 

Write a program in shell script to display the followings: A. the number of unique words in the file.

 

  1. the word which is present for maximum number of times in the file. [5 marks]

 

 

  1. Suppose you have a fibonacci sequence of length n, where n is a positive integer and multiple of 3. Now you decide to cut down the sequence in three equal segments and do an element-wise sum of the first and third segments. Finally, you concatenate the second segment to the summed segment. Write a program in shell script to represent these

procedures. Display the results after each step.                                                                      [8 marks]

 

  1. A folder named OS contains four non-empty and one empty text files. Each of the non-empty files contains different number of sentences. Write a program in shell script to copy the first sentence from each non-empty file to the empty file. The sentences should

 

be placed based on the ascending order of the size of the non-empty files.           [8 marks]