Final Project

By:
Manuel Montiel
Volodymyr Komendyak

#!/bin/bash
echo “List of Produce”
echo “1. Apple”
echo “2. Banana”
echo “3. Pear”
echo “4. Strawberry”
echo “5. Grape”
echo “6. Watermellon”
echo “999. Quit”
PNumber=0

while [ $PNumber -ne 999 ]; do
echo “Please Enter Produce Number or 999 to quit”
read PNumber

if [ $PNumber = 999 ]; then
echo “Finished”
elif [ $PNumber = 1 ]; then
echo “Apple Price is \$1.00”
elif [ $PNumber = 2 ]; then
echo “Banana Price is \$2.00”
elif [ $PNumber = 3 ]; then
echo “Pear Price is \$3.00”
elif [ $PNumber = 4 ]; then
echo “Strawberry Price is \$4.00”
elif [ $PNumber = 5 ]; then
echo “Grape Price is \$5.00”
elif [ $PNumber = 6 ]; then
echo “Watermellon Price is \$6.00”
else
$PNumber=999
echo “Finished”
fi
done

this project is a cataloging of various products. the script provides general databasing of items. the program is expandable by going into the code and adding more them. the project is also fairly robust because all possibilities are entered, there is 1 for all inputs, a clearly defined exit option and a final hidden exit in case the user entered an out of bounds query.

Leave a Reply

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