Operating Systems
CIS · Lab Final · Fall 24
shared by Rafsan Bin Habib
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Lab Final (OS) (Batch 18) Marks: 40
Date: 11-12-2024
u are managing a Student Management System for your university's Computer Science partment. The system needs to handle student records, grade calculation, for university super op you need to manage fruits shop and handle the process.
Directory Structure and File Management (15 marks)
Create a directory structure:
/university/CS/
- students/
- courses/
- attendance/
- backups/
- Create a file "student_records.txt" with following student information (one per line):
ID, Name, CGPA
(Add at least 5 students)
- Create a backup directory and copy student_records.txt there
- Change permissions of student_records.txt to allow read-write for owner, read for group, and no access for others
- Display the contents of student_records.txt
2. Shell Script - Grade Calculator (15 marks)
Create a script named "grade_calculator.sh" that:
- Prompts user to enter marks (0-100)
- Calculates and displays grade based on:
• 90-100: A+
• 80-89: A
• 70-79: B
• 60-69: C
• Below 60: F
- Stores results in "grade_report.txt"
- Make script executable and demonstrate its working
Fruit Shop Inventory
Create a script named "fruit_shop.sh" that:
- Creates an array of fruits: "Apple" "Banana" "Orange" "Mango" "Grape"
- Creates an array of prices: 2 1 3 4 2
- Using a loop, display both array like below:
1. Apple
2. Banana
and
1. $2
2. $1
3. Write an FCFS Scheduling Program in C to determine the average waiting time and average turnaround time given n processes and their burst times. (10 marks)
Process | Arrival Time | Burst Time
P1 | 0 | 5
P2 | 0 | 11
P3 | 0 | 11