11-13-2011
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
3 More Discussions You Might Find Interesting
1. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
i need to prompt the user for
a) group of scores
b) calculate the lowest and highest scores and... (1 Reply)
Discussion started by: bodhi 926
1 Replies
2. Shell Programming and Scripting
I'm taking a class right now and need ideas for a project. The scope is relatively vague: "Create a 'mash-up' program that combines system administration functions into a single application." I would say my skills working in bash are between average and slightly above average. I was originally... (2 Replies)
Discussion started by: d3mon_spawn
2 Replies
3. Shell Programming and Scripting
Hello people, I am new to the forum and to scripting and I'm honored to be a part of the Forum :)
At the moment I'm learning to do basic scripting for school.
Now I got 2 assignments that I do not understand. The case scripting I have mastered a bit. But now I have an assingment to make with... (1 Reply)
Discussion started by: hulsi88
1 Replies
ROGUE(6) BSD Games Manual ROGUE(6)
NAME
rogue -- exploring The Dungeons of Doom
SYNOPSIS
rogue [-s] [save_file]
DESCRIPTION
rogue is a computer fantasy game with a new twist. It is CRT oriented and the object of the game is to survive the attacks of various mon-
sters and get a lot of gold, rather than the puzzle solving orientation of most computer fantasy games.
To get started you really only need to know two commands. The command ? will give you a list of the available commands and the command /
will identify the things you see on the screen.
To win the game (as opposed to merely playing to beat other people's high scores) you must locate the Amulet of Yendor which is somewhere
below the 20th level of the dungeon and get it out. Nobody has achieved this yet and if somebody does, they will probably go down in history
as a hero among heroes.
When the game ends, either by your death, when you quit, or if you (by some miracle) manage to win, rogue will give you a list of the top-ten
scorers. The scoring is based entirely upon how much gold you get. There is a 10% penalty for getting yourself killed.
If save_file is specified, rogue will be restored from the specified saved game file.
The -s option will print out the list of scores.
For more detailed directions, read the document A Guide to the Dungeons of Doom.
FILES
/var/games/rogue.scores Score file
~/rogue.save Default save file
SEE ALSO
Michael C. Toy and Kenneth C. R. C. Arnold, A guide to the Dungeons of Doom.
AUTHORS
Timothy Stoehr
Michael C. Toy
Kenneth C. R. C. Arnold
Glenn Wichman
BUGS
Probably infinite, although none are known. However, that Ice Monsters sometimes transfix you permanently is not a bug. It's a feature.
BSD
May 31, 1993 BSD