Created
January 10, 2014 15:57
-
-
Save tmbritton/8356953 to your computer and use it in GitHub Desktop.
Quarterly bonus calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Bonus Calculator for WFM quarterly bonuses | |
read -p "What is your hourly rate? " rate | |
read -p "Is this a 12 or 16 week period? " weeks | |
read -p "What is your bonus percentage? (whole integer, not decimal) " percent | |
bonus=$(echo "$rate * 40 * $weeks * .$percent" | bc) | |
echo "Your full bonus is: $bonus" | |
read -p "Would you like to find a percentage of this total? (y/n)?" | |
if [ $REPLY == "y" ]; then | |
read -p "What percentage would you like to find? (whole integer, not decimal) " percentage | |
out=$(echo "$bonus * .$percentage" | bc) | |
echo "The grand total is: $out" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment