0% found this document useful (0 votes)
23 views7 pages

OS Lab Experiment 5 Ass 7

The document is a lab manual for an Operating Systems Lab experiment focused on implementing shell scripts to demonstrate conditional statements. It outlines the aim, learning outcomes, hardware/software requirements, problem definitions, theoretical concepts, program execution steps, and a conclusion regarding the understanding of conditional statements. The experiment includes tasks such as checking if a number is even or odd, finding the largest of three numbers, and calculating account balance with tax based on withdrawal amounts.

Uploaded by

ayushsidsingh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views7 pages

OS Lab Experiment 5 Ass 7

The document is a lab manual for an Operating Systems Lab experiment focused on implementing shell scripts to demonstrate conditional statements. It outlines the aim, learning outcomes, hardware/software requirements, problem definitions, theoretical concepts, program execution steps, and a conclusion regarding the understanding of conditional statements. The experiment includes tasks such as checking if a number is even or odd, finding the largest of three numbers, and calculating account balance with tax based on withdrawal amounts.

Uploaded by

ayushsidsingh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

LAB Manual

Name of Student: Bishwajeet Sahoo PRN: 23070122073

Semester: IV Year AY 24-25

Subject Title: Operating Systems Lab

EXPERIMENT No: 5 Assignment No : 7

TITLE: Conditional Statement DoP : 28/02/2025

Aim: Implement shell script to demonstrate conditional statements

Learning Outcomes: 1. To understand the conditional statements

2. To Demonstrate the shell script to demonstrate conditional


statements using Linux command.

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

b) Shell script to print the largest of three numbers

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:

i. Accept the account balance from the user

ii. Accept withdrawal amount from the user

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

Theory: Write theory about Conditional statements:

• if statement •

if-else statement

• if..elif..else..fi statement (Else If ladder)

• if..then..else..if..then..fi..fi..(Nested

Program:

1.

2.
3.
4.

Steps for execution:

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.

You might also like