#! /bin/bash
#Mehdi Golipoor
#CST8102 Operating System Fundamentals
#302 - Wednesday 9:30
#this script prompts user to add some marks, then it  gives them a garde in number, and letter
clear
read -p "Enter Assignment mark (0 - 40): " a
read -p "Enter Test 1 Mark (0 - 15): " t1
read -p "Enter Test 2 Mark (0 - 15): " t2
read -p "Enter Final exam mark (0 - 30): " f
ng=$((a+t1+t2+f))
if [ $ng -lt 50 ]
then
        lg="F"
elif [ $ng -lt 53 ]; then
        lg="D-"
elif [ $ng -lt 57 ]; then
        lg="D"
elif [ $ng -lt 60 ]; then
        lg="D+"
elif [ $ng -lt 63 ]; then
        lg="C-"
elif [ $ng -lt 67 ]; then
        lg="C"
elif [ $ng -lt 70 ]; then
        lg="C+"
elif [ $ng -lt 73 ]; then
        lg="B-"
elif [ $ng -lt 77 ]; then
        lg="B"
elif [ $ng -lt 80 ]; then
        lg="B+"
elif [ $ng -lt 85 ]; then
        lg="A-"
elif [ $ng -lt 90 ]; then
        lg="A"
else
        lg="A+"
fi
echo Your final numeric grade is $ng, and your final letter grade is $lg