En este programa tendrás que elegir que materia quieres llevar y después vas a poner tus 4 calificaciones del semestre. Con base en esas calificaciones obtendrás tu promedio.
Para obtener el promedio funciona de la siguiente manera:
#!/bin/bash
echo-e"GRADES AT SCHOOL \n\nSIGNATURES:"echo-e"1) Mathematics \n2) Physics \n3) Chemistry \n4) Computer Science \n5) Biology"read -p "Choose only one: " s1
if [ $s1 == 1 ]; then
signature="Mathematics"echo"You chose $signature"elif [ $s1 == 2 ]; then
signature="Physics"echo"You chose $signature"elif [ $s1 == 3 ]; then
signature="Chemistry"echo"You chose $signature"elif [ $s1 == 4 ]; then
signature="Computer Science"echo"You chose $signature"elif [ $s1 == 5 ]; then
signature="Biology"echo"You chose $signature"elseecho"You chose an invalid signature"firead -p "$signature first block: " f4
read -p "$signature second block: " s4
read -p "$signature third block: " t4
read -p "$signature forth block: " f4
echo-e"\nGRADES"
p1=$(( f4 + s4 ))
let p1/=2
echo"First partial: $p1"
p2=$(( t4 + f4 ))
let p2/=2
echo"Second partial: $p2"
average=$(( p1 +p2 ))
let average/=2
echo"Average of the semester in $signature: $average"