From f539796114b725a871d04ab532456bcb98b11a1f Mon Sep 17 00:00:00 2001 From: Ankam Ravi Kumar Date: Thu, 17 May 2018 23:09:25 +0530 Subject: [PATCH] Create arkit.co.in-nested-if.sh --- arkit.co.in-nested-if.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 arkit.co.in-nested-if.sh diff --git a/arkit.co.in-nested-if.sh b/arkit.co.in-nested-if.sh new file mode 100644 index 0000000..5be4b8d --- /dev/null +++ b/arkit.co.in-nested-if.sh @@ -0,0 +1,33 @@ +#!/bin/bash +#Purpose: Validate and report Student subject marks +#Version:1.0 +#Created Date: Wed May 16 19:00:52 IST 2018 +#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 #