Lab6

 

Screenshot from 2014-11-12 20:42:08

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.

Screenshot from 2014-11-12 20:45:50

Screenshot from 2014-11-19 21:21:10

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.

Screenshot from 2014-11-19 21:24:21

Screenshot from 2014-11-19 21:26:04

Screenshot from 2014-11-19 21:27:05

Screenshot from 2014-11-19 21:28:11

Screenshot from 2014-11-19 21:29:01

Screenshot from 2014-12-03 20:39:38 this is the result

Screenshot from 2014-12-03 20:40:30 this is the script i used.

#!/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”

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *