Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f539796

Browse files
author
Ankam Ravi Kumar
authored
Create arkit.co.in-nested-if.sh
1 parent a701b07 commit f539796

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

arkit.co.in-nested-if.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
#Purpose: Validate and report Student subject marks
3+
#Version:1.0
4+
#Created Date: Wed May 16 19:00:52 IST 2018
5+
#Modified Date:
6+
#Author: Ankam Ravi Kumar
7+
# START #
8+
echo -e "Please Enter Maths Marks: \c"
9+
read -r m
10+
echo -e "Please Enter Physics Marks: \c"
11+
read -r p
12+
echo -e "Please Enter Chemistry Marks: \c"
13+
read -r c
14+
15+
if [ $m -ge 35 -a $p -ge 35 -a $c -ge 35 ]; then
16+
total=`expr $m + $p + $c`
17+
avg=`expr $total / 3`
18+
echo "Total Marks = $total"
19+
echo "Average Marks = $avg"
20+
if [ $avg -ge 75 ]; then
21+
echo "Congrats you got Distinction"
22+
elif [ $avg -ge 60 -a $avg -lt 75 ]; then
23+
echo "Congrats you got First Class"
24+
elif [ $avg -ge 50 -a $avg -lt 60 ]; then
25+
echo "You got second class"
26+
elif [ $avg -ge 35 -a $avg -lt 50 ]; then
27+
echo "You Got Third Class"
28+
fi
29+
else
30+
echo "Sorry You Failed"
31+
fi
32+
33+
# END #

0 commit comments

Comments
 (0)