CSE 321 Operating Systems Solved

$ 20.99
Category:

Description

Lab Assignment 1
Total Marks: 25

1. The following questions are related to Linux Shell Command

a. Create 4 files named yourID_1.txt, yourID_2.txt, yourID_3, yourID_4.txt and 2 directories named YourName1, YourName2.
Move yourID_1.txt, yourID_2.txt, yourID_3.txt in YourName1 directory.
Copy yourID_1.txt, yourID_2.txt YourName2 directory.
Create another directory YourName3.
Now, copy the YourName1 directory along with its contents to the YourName3 directory. Now go into the YourName3 directory and check the permissions of the files/directory and change the permissions for both groups and others to only read-execute for all the files. Now go back to one directory and print all the directories and files in the current working directory. Finally, move the YourName3 folder to the root directory and delete the rest of the files and folders in the current working directory.
Write down all the commands in the exact same order as you have written in the command
line while following the instructions. [5 Marks]
b. Create a file containing your running semester’s course information (course IDs, Course names, Sections, etc.) Count the lines containing the word “CSE” in that file named course.txt
[2 Marks]
c. Show all the hidden files in your root directory. [2 Marks]
d. Show only lines 5-17 of a .txt file(you have to create a file containing more than 17 line)
[2 Marks]

2. The following questions are related to C Programming

a. Write a program where you have to take 2 numerical inputs and 1 input for operator {the operator input has to be either ‘+’, ’-’, ’*’). Depending on some comparisons, you need to carry
out three operations: addition ( + ), subtraction ( – ), and multiplication ( * ). Each of these operations will be implemented in separate methods.
[2 Marks]
i. If the first number is greater than the second number, do subtraction and print the result. ii. If the first number is less than the second number, perform addition and print the result. iii. If the second number is equal to the second number, do multiplication and print the result

b. Write a program that allows you to erase multiple spaces in a text file. Then re-write the
sentence without extra spaces in another text file. [3 Marks]
Input:
I love Python Programming.
Output:
I love Python Programming.

=========================================================
Hints:
You can use the split function to separate the words into a list.
c. Again, you have lost your USIS password!! You went to the registrar’s office and requested a new password. This time, you need to follow some rules to set your password. Otherwise, they won’t change it. The rules are:
• At least one lowercase letter
• At least one uppercase letter
• At least one digit (0-9)
• At least one special character (_ , $, #, @)
Your task is to find whether a given password follows all those rules. If it breaks any rule, you have to print “Lowercase character missing”, “Uppercase character missing”, “Digit missing” or “Special character missing” respective to the missing case. For more than one rule break, print all the rules that were broken (order doesn’t matter). If the password is ok, print “OK” [3 Marks]
Sample Input:
• BR@CUspring
• bracuspring
• BR@CU20spring22
Sample Output
• Digit missing
• Uppercase character missing, Digit missing, Special character missing • OK
d. A company named Sheba.xyz has recently moved from their old domain to a new domain.
However, a lot of the company email addresses are still using the old one
(employeeName@kaaj.com). Write a function in C that takes the email id of an employee as input and checks whether that email id is updated (I.E. using the new domain
employeeName@sheba.xyz) or not. [3 Marks]
Sample Input:
• fahmid@kaaj.com
• zaki@sheba.xyz
Sample Output:
• Email address is outdated • Email address is okay
e. Take a string input from the user and find out whether it is a palindrome using pointers.
[3 Marks] Sample Input:
AAABBAAA AABBABA aabcbaa
Sample Output:
Palindrome
Not Palindrome
Palindrome

Reviews

There are no reviews yet.

Be the first to review “CSE 321 Operating Systems Solved”

Your email address will not be published. Required fields are marked *