mirror of
https://github.com/techarkit/shell-scripting-tutorial.git
synced 2025-07-28 23:28:40 +00:00
Update and rename arkit.co.in-nested-if.sh to ExamResults.sh
This commit is contained in:
34
ExamResults.sh
Normal file
34
ExamResults.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
#Purpose: Validate and report Student subject marks
|
||||
#Version:1.0
|
||||
#Created Date: 2024 sep
|
||||
#Modified Date:
|
||||
#Author: Ankam Ravi Kumar
|
||||
# START #
|
||||
|
||||
echo -e "Please Enter Maths Marks: \c"
|
||||
read -r m
|
||||
echo -e "Please Enter Physics Marks: \c"
|
||||
read -r p
|
||||
echo -e "Please Enter Chemistry Marks: \c"
|
||||
read -r c
|
||||
|
||||
if [ $m -ge 35 -a $p -ge 35 -a $c -ge 35 ]; then
|
||||
total=`expr $m + $p + $c`
|
||||
avg=`expr $total / 3`
|
||||
echo "Total Marks = $total"
|
||||
echo "Average Marks = $avg"
|
||||
if [ $avg -ge 75 ]; then
|
||||
echo "Congrats you got Distinction"
|
||||
elif [ $avg -ge 60 -a $avg -lt 75 ]; then
|
||||
echo "Congrats you got First Class"
|
||||
elif [ $avg -ge 50 -a $avg -lt 60 ]; then
|
||||
echo "You got second class"
|
||||
elif [ $avg -ge 35 -a $avg -lt 50 ]; then
|
||||
echo "You Got Third Class"
|
||||
fi
|
||||
else
|
||||
echo "Sorry You Failed"
|
||||
fi
|
||||
|
||||
# END #
|
Reference in New Issue
Block a user