Question 1: Write an algorithm/program that accepts an input a decimal number and converts it into octal representation.
Question 2: Give the complete specifications for the passes of a
two-pass assembler indicating:
Tables for internal use of the passes
Tables to be shared between passes
Inputs (files and tables) for every pass
Outputs (files and tables) of every pass
You must specify why certain information is in the form of tables
in main memory while other information is in the form of files. Also
recommend appropriate organizations for the tables and files used
in the two-pass assembler.
Question 3: Compare and contrast the features of UNIX with WINDOWS VISTA operating system.
Question 4: Write the UNIX commands for the following:
(a) Use the more command, and a pipe to send the contents of your
.profile and .shrc files to the screen.
(b) How could you use head and tail in a pipeline to display lines
25 through 75 of a file?
(c) To search the /etc/passwd file for the lines containing any input
string given by the user.
(d) To see the lines in /etc/passwd that begins with the character
"a".
(e) List all the files in the /tmp directory owned by the user root.
(f) To see a complete listing of all the processes currently scheduled.
(g) Use the ps command, and the grep command, in a pipeline to find
all the processes owned by you.
(h) To force termination of a job whose process ID is given.
(i) Sort the /etc/passwd file, place the results in a file called
foo, and trap any errors in a file called err with the command.
(j) To sort a file called foo, and place the results in a file called
bar.
CS-02 Introduction to Software
Assignment Code : MCA(1)-02/Project/2008
Note : This is a Project. Answer all the questions. Each question
carries equal weightage.
You may use illustrations and diagrams to enhance explanations.
Question 1: Write a regular expression for the following statements
of C language:
i. Variable declaration
ii. Function declaration
iii. Do….while looping construct
Question 2: Write shell programs for the following:
(a) To find the largest number among the 3 numbers given.
(b) To check whether the given 5-digit number is a palindrome or not.
(c) To sort the given list of numbers in ascending order.
(d) To check, how many times a given string occurs in a given a text
file.
(e) To find the factorial of a given number.