Saturday 17 March 2012

Grading System In Linux


Grading System In Linux Programming by Shell script.

echo enter the name of student
read name
echo enter section
read section
echo enter marks of maths
read maths
echo enter marks of physics
read phy
echo enter marks of chemistry
read chem
if [ $maths -lt 35 ]
then
m=fail
elif [ $maths -lt 50 ]
then
m=C
elif [ $maths -lt 70 ]
then
m=B
elif [ $maths -lt 80 ]
then
m=A
elif [ $maths -lt 100 ]
then
m=A+
fi

if [ $phy -lt 35 ]
then
p=fail
elif [ $phy -lt 50 ]
then
p=C
elif [ $phy -lt 70 ]
then
p=B
elif [ $phy -lt 80 ]
then
p=A
elif [ $phy -le 100 ]
then
p=A+
fi

if [ $chem -lt 35 ]
then
c=fail
elif [ $chem -lt 50 ]
then
c=C
elif [ $chem -lt 70 ]
then
c=B
elif [ $chem -lt 80 ]
then
c=A
elif [ $chem -le 100 ]
then
c=A+
fi
echo name:$name section:$section
echo subject:      grades:
echo maths:        $m
echo physics:      $p
echo chemistry:    $c



No comments:

Post a Comment