internal 3
SECTION A 20 MARKS
1. Assuming you have the following table format:
EMPLOYEE TABLE
NAME SURNAME AGE DEPARTMENT
Mpho Maama 41 Works
Lerato Seeiso 54 I.T
LipalesaNaleli 29 Administration
a. Your aim is to add a new member that just arrived. Create a single shell script that will have functions that:
(i) Insert/Add a new employee (Name, Surname, Age, and Department). [4 Marks]
(ii) Classify the employee as an adult if they are above the age of 21 otherwise, as under-age. [4 Marks]
(iii) Display the Names, Surnames, Ages and Departments of the employee you inserted. [2 Marks]
b. Lipalesa just moved to the I.T department, write a shell script to modify/change her department from Administration to I.T then display Lipalesa’s information with her new department [4 Marks]
c.
Write a shell script to display the week of the day based on the given number (1 for Sunday, 2 for Monday … 7 for Saturday) using both nested IF and CASE conditional statements. [6 Marks]
|