12345678910111213141516171819202122 |
- BEGIN{
- print "----------------------------------------------WELCOME TO VIT-----------------------------------------------------------"
- print "Roll_No\t\tName_of_student\t\tMath\t\tPhysics\t\tChemistry\t\tTotal\t\tGrade"
- print "-----------------------------------------------------------------------------------------------------------------------"
- }
- {
- total= $3 + $4 + $5
- avg= total/3
- if ( avg >= 90)
- grade= "A"
- else if ( avg >= 75 && avg < 90 )
- grade= "B"
- else if ( avg >= 45 && avg <75 )
- grade= "C"
- else
- grade= "F"
- print $0"\t\t\t"total"\t\t"grade"\t"
- }
- END{
- print "------------------------------------------------THANK YOU--------------------------------------------------------------"
- }
|