11-13-2011
2,
0
Join Date: Nov 2011
Last Activity: 15 November 2011, 9:35 AM EST
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
shell scripting project for school
i need to prompt the user for
a) group of scores
b) calculate the lowest and highest scores and overall average
c) print out to the screen
d ask if user has any more data to process, if so repeat (loop) for a new set of scores if not exit.
i have this much,and trust me i know there is a lot missing
#!/bin/bash
echo
echo -n "Enter the first score (abc to exit): "
read $score
until [[ $first == abc ]]
do
echo -n "Enter the next score: "
read $score
until
echo -n "Enter d if all scores are entered: "
read $score
[[ $score == $score+1 ]]
echo "The result is: $ans"
done
echo "Goodbye"
echo
exit 0
I know I am on the right track, but Unix is new to me (school project) I am just looking for help, ive been around since the dos days and have played some with vb, basic, etc. but its been awhile, any help is appreciated (its due Wednesday!!)
---------- Post updated at 01:59 PM ---------- Previous update was at 01:23 PM ----------
#THIS IS WHAT I HAVE SO FAR, WILL KEEP WORKING
#!/bin/bash
echo
echo -n "Enter the first score (abc to exit): "
read $score
until [[ $first == abc ]]
do
echo -n "Enter the next score: "
read $score
until
echo -n "Enter d if all scores are entered: "
read $score
if [[ $oper == d ]]
then
#this would be the sum of scores
(( $ans == $score + 1 ))
(( $ans == $score + $score + 1 ))
then
#this would be the avg of scores
(( $ans == $score / ?))
then (( $hilo == $score < >))
#this would be highest and lowest
then (( $avg == ))
fi
#print out
echo "The sum is: $ans $hilo $avg"
echo "The High Low scores are $hilo"
echo "The average score is $avg"
echo -n "Do you want to input a new batch of scores? (abc to exit): "
read $score
if [[ $oper == d ]]
then
else
fi
done
echo "Goodbye"
echo
exit 0