0% found this document useful (0 votes)
47 views

IT112: Computer Systems Lab (End Sem Exam Questions Set - April 2022)

This document outlines 6 questions for an end semester exam in a Computer Systems Lab course. The questions cover topics like downloading a file using commands in Linux, listing open TCP connections, overriding functions in shell scripts, writing Java programs to check for cousin prime numbers and vowels/consonants, and printing an inverted heart shape using the alphabet. Students are asked to demonstrate skills like manipulating files and processes from the command line, writing shell scripts to declare variables and override functions, and developing Java programs that accept user input and perform conditional checks and printing patterns. The exam is out of 40 total marks and lasts 2 hours.

Uploaded by

DARSHAN R.k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

IT112: Computer Systems Lab (End Sem Exam Questions Set - April 2022)

This document outlines 6 questions for an end semester exam in a Computer Systems Lab course. The questions cover topics like downloading a file using commands in Linux, listing open TCP connections, overriding functions in shell scripts, writing Java programs to check for cousin prime numbers and vowels/consonants, and printing an inverted heart shape using the alphabet. Students are asked to demonstrate skills like manipulating files and processes from the command line, writing shell scripts to declare variables and override functions, and developing Java programs that accept user input and perform conditional checks and printing patterns. The exam is out of 40 total marks and lasts 2 hours.

Uploaded by

DARSHAN R.k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

IT112: Computer Systems Lab

(End Sem Exam Questions Set – April 2022)


Total Marks: 40
Duration: 2 Hours

1. a) Download the file present at this link


http://mirror.ufs.ac.za/linuxmint/stable/14/linuxmint-14-kde-dvd-64bit.iso (use any
other large file if the link is not accessible) using a command.
b) While the file is downloading open another terminal and list any open TCP
connections and locate the process id of the commaond downloading the file.
c) Finally kill the process using the process id and show that the download process is
killed.
(1+3+2 = 6 Marks)

2. a) Display all active ports on your local system after opening a browser and an
application like MS teams.
b) Using the output of 2a display only active ports on tcp processes and active ports
on tcp6 processes (if available otherwise write the command(s) for the same).
c) Using the output of 2a display only active ports on udp processes and active ports
on udp6 processes (if available otherwise write the command(s) for the same).
(2+2+2 = 6 Marks)

3. a) How do you execute a shell script which has no executable permission ? (Display
the permissions of the shell script before executing it).
b) Write shell script (bash) that declares and assigns a local variable “local_hello” and
a system variable “SYSTEM_HELLO” containing values “hello from local” and
“hello from SYSTEM” repectively. Execute shell script and display the output
c) Echo the contents of the the variables local_hello and SYSTEM_HELLO directly
from the terminal (without using the shell script).
(1+3+2 = 6 Marks)
4. a) Write a shell script to print multiples of 3 from 30 in reverse order.
b) Write shell script to override the echo function of bash and print the following
output
[04-04 11:28:15] : Welcome to Java
ie [DD-MM HH:MM:SS] : Welcome to Java
(Date time may be used from date function)
when echo “Welcome to Java” is used in the shell script.
(3+3 = 6 Marks)
5. a) Write a java program to allow the user to enter two numbers and check if the
entered numbers are Cousin Primes (ie entered numbers are primes and their
difference is 4). (Test atleast 3 scenarios where primes, cousin primes and non primes
are entered)
b) Write a java program that accepts a character from the user and prints if the entered
character is a consonant or a vowel or neither of the two. (Test all three scenarios)
(4+4 = 8 Marks)
6. Write a java program to print an inverted heart shape using the lower case English
alphabet.
(8 Marks)

You might also like