IT112: Computer Systems Lab (End Sem Exam Questions Set - April 2022)
IT112: Computer Systems Lab (End Sem Exam Questions Set - April 2022)
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)