Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Shell Script for generating a mark sheet

Posted By: Imelda Miller     Category: Unix / Linux / Ubuntu     Views: 13380

Write a Shell Script for generating a mark sheet.

Code for Shell Script for generating a mark sheet in Unix / Linux / Ubuntu

echo "Enter the five subject marks for the student"
read m1 m2 m3 m4 m5
sum1=`expr $m1 + $m2 + $m3 + $m4 + $m5`
echo "Sum of 5 subjects are: " $sum1
per=`expr $sum1 / 5`
echo " Percentage: " $per
if [ $per -ge 60 ]
then
echo "You get Distinction”
elif [ $per -ge 50 ]
then
echo “You get First class”
elif [ $per -ge  40 ]
then
echo "You get Second class"
else
     echo "You get Fail"
fi


OUTPUT
**********
     [04mca58@LINTEL 04mca58]$ sh filemenu.sh
     Enter the five subject marks for the student
     45 
     35
     30
     40
     42    
     Sum of 5 subjects are: 192
     Percentage : 76.8
You get Distinction
  
Share: 


Didn't find what you were looking for? Find more on Shell Script for generating a mark sheet Or get search suggestion and latest updates.

Imelda Miller
Imelda Miller author of Shell Script for generating a mark sheet is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!