OS Lab Experiment 5 Ass 7
OS Lab Experiment 5 Ass 7
Hardware/Software:
● Name - Ubuntu
● Operating System - Ubuntu(64-bit)
● Base Memory - 4096MB
● Processor - 4
● Video Memory - 16MB
● Boot Order - Hard Disk , Optical , Floppy
Problem Definition:
a) Shell script to print whether the number entered by the user is even or odd
c) Shell script to print whether the year entered by the user is leap year or not
d) Shell script to calculate balance of the account based on the following conditions:
iii. If withdrawal amount < 1500 then calculate the tax as 3% of the withdrawal amount
iv. If withdrawal amount >1500 and less than 3000 then calculate the tax as 4% of the
withdrawal amount
v. If withdrawal amount > 3000 then calculate the tax as 5% of the withdrawal amount
vi. If balance is less than withdrawal amount then print insufficient balance vii. Print
amount withdrawn along with tax deducted
• if statement •
if-else statement
• if..then..else..if..then..fi..fi..(Nested
Program:
1.
2.
3.
4.
1. gedit program.sh
2. bash program.sh
Output:
1.
2.
3.
4.
Conclusion: In this experiment we understood all the conditional statements including
if-then, if-else, nested if. We also implemented these conditional statements successfully
in various real-life scenario related problems.