this this script, we have to ask the user for their name, course code, and grade percentage. then we will run it, and ask the user to input their information. at the end it will display all of the information in line one.
for this script, i made it so that when you enter a grade higher than 100, it will ask user to enter another grade lower than 100. when a grade is between the range it will show the user the letter grade they get.
#!/bin/bash
echo “enter an integer.”
read n
i=n
sum=0
while [ $n -ge 1 ]; do
sum=$(($n + $sum));
n=$(($n – 1));
done;
echo “the sum of the first $i integer is $sum”