Advertisement
Advertisement
| 05.10.2008 at 08:29AM PDT, ID: 23391739 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: |
#!/bin/sh # Tells the OS (Operating System) to use the Bourn Shell
booking() # Function called welcome.
{
clear # Clears the screen as soon as the script starts.
echo "" # Echo's blank lines to screen.
echo ""
echo ""
echo " ***************************Welcome to Room Booking Services*****************************"
echo ""
date +"You are logged in at $HOSTNAME, as $USER. It is %c"
echo "Please Enter Name >>>\c" #Waits for user to enter information.
read NAME #Reads information entered, and puts
#it into NAME (a variable)
echo "Please Enter No. of Days >>>\c" #Waits for user to enter information.
read DAYS #Reads information entered, and puts
#it into DAYS (a variable)
echo "Please Chose Size of Room >>>\c"
echo " S or s ? Single Bed"
echo " D or d ? Double Bed"
echo " T or t ? Double Bed >>>\c" #Waits for user to enter information.
read SIZE #Reads information entered, and puts
#it into SIZE (a variable)
if [ $SIZE -eq "s" | $SIZE -eq "S" ]
then
echo val = $DAYS * 150
elif [ $SIZE -eq "d" | $SIZE -eq "D" ]
then
echo val = $DAYS * 210
elif [ $SIZE -eq "t" | $SIZE -eq "T" ]
then
echo val = $DAYS * 250
else
echo "Invalid Size Was Selected"
fi
echo " ***************************Billing Details are as Follows*****************************"
echo ""
echo "Customer Name: "
echo $NAME
echo "No. of Days: "
echo $val
echo "Total Calculated Amount: "
echo $val
} # End of function called booking
# Below is the Start of the main body of program (the while loop)
clear # Clears the screen
while true # True is a statement that returns true (1). So by saying
do # while true it is like saying "do this until something
# happens to be false (like hitting ctrl C or delete)
echo ""
echo ""
echo " Room Booking Services"
echo ""
echo ""
echo ""
echo " 1. Make a Room Booking"
echo " 2. Exit From the System
echo ""
echo "Enter Option >>>\c"
read ANS # Waits for user to enter something
# and stores the input in $ANS
case $ANS in
1 ) booking;; # If $ANS is 1 call booking
2 ) clear; exit;; # If $ANS is 2 clear screen and exit
* ) echo "INVALID CHOICE!"; sleep 2; clear;; # Echo the error message
# sleeps 2 seconds and
# clears the screen
esac
done
|