Question

In: Computer Science

It’s that wonderful joyful time of the year again. That’s right! It’s Tax Time!

Using BASH. 

It’s that wonderful joyful time of the year again. That’s right! It’s Tax Time! You have been hired by CIT Taxing & Associates to develop a script that will take in a person's gross income and total taxes paid to Uncle Sam (the federal government) and spit out that person’s tax bracket and total taxes that he/she owes. To complete the script you will need to use an IFstatement as well as follow these guidelines:

Name The Script: tax_man

● Prompt the user for their GROSS Income

● Prompt the user for total FEDERAL taxes already paid by wage garnishes.

● Using a IF STATEMENT use the following tax information to determine how much the person owes or is

owed

Gross Pay

Tax Rate

$0 - $15,000

0%

$15,001 - $60,000

5%

$60,001 - $85,000

10%

$85,001 - $200,000

20%

$200,001 + (DEFAULT)

25%

● To determine how much is owed to the government (or how much is owed to the user), use the following equation: $ (( ( gross_pay * tax_rate ) - already_paid ))

● Finally, For The Final Tax Bracket ($200,001+), make this theELSE Code Block For The IF Statement

● In order to handle decimals, we need to use the bc command. When making your equation, format your equation as follows: amount=$(echo “scale=2; ($gross_pay *$ tax_rate) - $already_paid” | bc)

Solutions

Expert Solution

#bash script

#!/bin/bash

# Reading gross pay from user
read -p 'Enter Your Gross Pay: ' gross_pay

# Reading federal taxes already paid from user
read -p 'Enter the amount of federal taxes already paid: ' already_paid

# Gross pay: $0 - $15,000 -> 0%
if [ $gross_pay -ge 0 -a $gross_pay -le 15000 ]; then

# tax rate is 0
tax_rate=0
rate=0

# Gross pay: $15,001 - $60,000 -> 5%
elif [ $gross_pay -ge 15001 -a $gross_pay -le 60000 ]; then

# tax rate is 5
tax_rate=0.05
rate=5

# Gross pay: $60,001 - $85,000 -> 10%
elif [ $gross_pay -ge 60001 -a $gross_pay -le 85000 ]; then

# tax rate is 10
tax_rate=0.10
rate=10

# Gross pay: $85,001 - $200,000 -> 20%
elif [ $gross_pay -ge 85001 -a $gross_pay -le 200000 ]; then

# tax rate is 20
tax_rate=0.20
rate=20

# Gross Pay greater than $200,001 -> 25%
else

# tax rate is 25
tax_rate=0.25
rate=25

fi

#printing new line
echo ""
echo ""

# Calculating amount owed
amount=$(echo "scale=2; ($gross_pay * $tax_rate) - $already_paid" | bc)

# Printing results
echo -n "You Owe: \$$amount"

#printing new line
echo ""

# Printing results
echo -n "Your Tax Rate is $rate% of your gross pay"

#printing new line
echo ""
echo ""


Related Solutions

Cara had been over her resume again and again. She was sure it was right. The...
Cara had been over her resume again and again. She was sure it was right. The night before the interview, she printed out a few copies to take with her. She looked this version so it would be fresh in her mind. Suddenly she noticed that she had made two errors! She had misspelled the company name with an ie rather than an ei, and she had used too instead of to. She quickly fixed both mistakes and was thankful...
For tax year 2018 all of the following are true regarding the Claim of Right deduction...
For tax year 2018 all of the following are true regarding the Claim of Right deduction under California tax law except: Group of answer choices Deductions of $3,000 or less are not allowed because they are subject to the 2% Federal adjusted gross income (AGI) limit If the amount repaid was not taxed by California, then no credit is allowed If the taxpayer is eligible to take the credit for California, he or she adds the credit amount on line...
Note: don't copy paste answer again and again its my 3rd attempt and each time same...
Note: don't copy paste answer again and again its my 3rd attempt and each time same picture of answers uploaded i need the actual answers of the following question Problem:       Suppose that the demand for Cod Liver Oil (CLO) can be written QD =5000-2P (so, the inverse demand curve for CLO is P=2500-0.5QD), where P is the price per ton (in dollars) of CLO and QD is the quantity demanded (in tons) in a period. Use Excel Scatterplots to...
A firm has after rate income tax last year of $3.0. It’s depreciation expenses were 0.2...
A firm has after rate income tax last year of $3.0. It’s depreciation expenses were 0.2 million, and its total cash flow was $3.0 million. What happened to the net working capital during the year.
19) Your friends are at it again. This time they are testing H0 : μ =...
19) Your friends are at it again. This time they are testing H0 : μ = 14 versus H1 : μ ≠ 14. They have found that x̅ = 13.5, x̅cu = 14.7, n = 64 and they know σ = 2.5 . a) Do your reject H0 ? Explain. b) Find alpha. c) Find the p-value. d) Find beta if mu is really 14.3.
Once again, consider the Cobb-Douglas production function ? = ?? ?? ? . a) This time,...
Once again, consider the Cobb-Douglas production function ? = ?? ?? ? . a) This time, derive the conditional input demands ? ∗ (?, ?, ?) and ? ∗ (?, ?, ?) and the associated long-run cost function ?(?, ?, ?) under the assumption that ? + ? = 1. b) Describe the average cost and marginal cost functions. How do they depend on output q and factor prices w and r? Explain. c) Continuing to assume ? + ?...
Research Problem 1. Wonderful Wilderness, Inc., is a tax-exempt organization. Its mission is to “explore, enjoy,...
Research Problem 1. Wonderful Wilderness, Inc., is a tax-exempt organization. Its mission is to “explore, enjoy, and protect the wild places of the earth; practice and promote the responsible use of the earth’s ecosystems and resources; educate and enlist humanity to protect and restore the quality of the natural and human environment; and use all lawful means to carry out these objectives.” Lloyd Morgan, the chief financial officer, presents you with the following information. Wonderful Wilderness raises funds to support...
Which of the following statements is true of the tax treatment of uninsured losses? A. It’s...
Which of the following statements is true of the tax treatment of uninsured losses? A. It’s the same as the financial reporting of uninsured losses. B. It allows for a firm to choose when the loss will be deducted. C. It’s the same for insurance companies and non-insurance companies. D. It requires that the loss be deducted in the year it’s paid.
Assume this week is the end of 2018. It has been a wonderful year-end for you...
Assume this week is the end of 2018. It has been a wonderful year-end for you because your business Computer Servicing and Networking Business was doing great! But don't forget that you need to complete adjusting entities on Dec 31, 2018. Please give me one each example of two types of adjusting entries: 1. Deferred accounts 2. Accrued accounts Please feel free to read the text books, but make sure you use transactions of your own company. For example: 1....
5.2. Recall, again, that the time to first pruning of basil plants is known to be...
5.2. Recall, again, that the time to first pruning of basil plants is known to be normally distributed with an average of µ = 35 days and a standard deviation of σ = 3 days. This term, n another l ab with a stable environment where no construction i s going on, students i n Kathleen’s class are trying a new fertilizer combination on their standard sweet basil plants. They are interested in whether this new fertilizer is improving (decreasing)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT