|
Hi everyone, is there anyway that i can echo out my total bill that i have selected in my cafe&bar coding here? what i mean is, example i have selected two order in there, and at the end it will print out the total bill i have selected.. thank you for helping...
#!/bin/bash
function pause(){
read -p "Press [Enter] to continue order..."
[ $readEnterKey ] && { echo; echo "Your Order has been Completed"; } || echo
}
function message(){
echo "$@"
pause
}
function display_meals_menu(){
clear
echo "-------------------------------"
echo " Cafe&Bar"
echo "-------------------------------"
echo " Meal Menu"
echo "-------------------------------"
echo
echo "1. Lamb Shank 10 dollar."
echo "2. Tom Yam Fried Rice 15 dollar."
echo "3. Lovers Rice 10 dollar."
echo "4. Curry Rice 12 dollar."
echo "5. Jelof Rice 15 dollar."
echo "6. Fairy Rice 10 dollar."
echo "7. Spicy Stew Rice 18 dollar."
echo "8. Exit"
read -p "Enter your choice [ 1 -7 ] " Meal
case $Meal in
1) message "You Just Selected Chichen Fried Rice";;
2) message "You Just Selected Tom Yam Fried Rice";;
3) message "You Just Selected Lovers Rice";;
4) message "You Just Selected Curry Rice";;
5) message "You Just Selected Jelof Rice";;
6) message "You Just Selected Fairy Rice";;
7) message "You Just Selected Spicy Rice";;
8) echo "Bye!"; exit 0;;
*) echo "Error: Invalid option..."; read -p "Press [Enter] key to continue...";;
esac
function show_main_menu(){
clear
# display menu
echo "-------------------------------"
echo " Cafe&Bar"
echo "-------------------------------"
echo " Main Menu"
echo "-------------------------------"
echo " $(date)"
echo "-------------------------------"
echo "1. Display Meal Menu."
echo "2. Drinks
echo "3. Deserts
echo "4. Exit"
# get input from the user
read -p "Enter your choice [ 1 -4 ] " choice
# make decision using case..in..esac
case $choice in
1) display_meals_menu;;
2) display_drinks_menu;;
3) display_deserts_menu;;
4) echo "Bye"; exit 0;;
*) echo "Default "
esac
}
while true
do
show_main_menu
done
|