Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The rerevised tax code The new system is different. Tax deductions have been rep

ID: 3852790 • Letter: T

Question

The rerevised tax code

The new system is different. Tax deductions have been replaced with tax credits, and… well, here’s a picture of the worksheet, and the new rules.

The Code, So Pay Attention

Wages: 80% of the first $50,000 is taxable, 100% of the rest is taxable.

Investment income: 100% is taxable.

Imaginary extra income (the difference between your real income and what you tell your cousins at the family reunion): 40% of the first $100,000 plus 70% of the rest is taxable.

Beauty benefit (the economic edge attractive people have): 150% is taxable, because the rest of us are jealous.

$1,000 tax credit for each human dependent, up to four. No credit for additional dependents.

$1,300 tax credit if you have one dog, $3,000 if you have two, with no credit for additional dogs.

$50 tax credit for the first cat, with no additional credit for more cats.

50% credit for educational expenses.

10% credit for jean jacket expenses.

40% credit for charitable donations. Unless you told your mother that you donated more than you did, in which case there is no credit.

Line 32 will indicate whether you owe us, or we owe you.

Taxable income is taxed according to the following table:

Here is my code thus far, can you help me?

Option Explicit

Private Sub cmdRun_Click()
'Income
Dim incomeWages As Single
Dim taxableWages As Single
Dim incomeInvestments As Single
Dim incomeImaginary As Single
Dim taxableImaginary As Single
Dim incomeBeauty As Single
Dim taxableBeauty As Single
Dim totalTaxableIncome As Single
'Dependents
Dim numHumans As Integer
Dim numDogs As Integer
Dim numCats As Integer
Dim dependCreditHumans As Single
Dim dependCreditDogs As Single
Dim dependCreditCats As Single
Dim totalDependTaxCredit As Single
'Random
Dim educationalExpenses As Single
Dim creditEducational As Single
Dim jeanJacketExpenses As Single
Dim creditJeanJackets As Single
Dim charitableActual As Single
Dim charitableMother As Single
Dim creditCharitable As Single
Dim totalRandomTaxCredit As Single
'Payments
Dim taxWithheld As Single
Dim guilt As Single
Dim totalPayments As Single
'Final calculation
Dim grossTax As Single
Dim taxDue As Single
Dim owedMessage As String
Dim owed As Single
  
'Compute taxable income
'Get input
incomeWages = Cells(5, 2)
incomeInvestments = Cells(6, 2)
incomeImaginary = Cells(7, 2)
incomeBeauty = Cells(7, 2)
'Wages
If incomeWages <= 50000 Then
taxableWages = 40000 '50000 * 0.8
Else
taxableWages = 40000 + (incomeWages - 50000)
End If
'Imaginary
If incomeImaginary <= 100000 Then
taxableImaginary = incomeImaginary * 0.4
Else
taxableImaginary = 100000 * 0.4 _
+ (incomeImaginary - 100000) * 0.7
End If
'Beauty benefit
taxableBeauty = incomeBeauty * 1.5
'Total taxable income
totalTaxableIncome = Round(taxableWages + incomeInvestments _
+ taxableImaginary + taxableBeauty)
Cells(9, 2) = totalTaxableIncome
  
'Dependents
numHumans = Cells(12, 2)
numDogs = Cells(13, 2)
numCats = Cells(14, 2)
'Humans credit
If numHumans <= 4 Then
dependCreditHumans = numHumans * 1000
Else
dependCreditHumans = 4000
End If
'Dogs credit
dependCreditDogs = 0
If numDogs = 1 Then
dependCreditDogs = 1300
Else
dependCreditDogs = 3000
End If
'Cats credit
dependCreditCats = 0
If numCats >= 1 Then
dependCreditCats = 50
End If
totalDependTaxCredit = Round(dependCreditHumans _
+ dependCreditDogs + dependCreditCats)
Cells(15, 2) = totalDependTaxCredit
  
'Random
educationalExpenses = Cells(18, 2)
jeanJacketExpenses = Cells(19, 2)
charitableActual = Cells(21, 2)
charitableMother = Cells(22, 2)
creditEducational = educationalExpenses * 0.5
creditJeanJackets = jeanJacketExpenses * 0.1
creditCharitable = 0
If charitableMother < charitableActual Then
creditCharitable = charitableActual * 0.4
End If
totalRandomTaxCredit = Round(creditEducational _
+ creditJeanJackets + creditCharitable)
Cells(23, 2) = totalRandomTaxCredit
  
'Compute tax due
If totalTaxableIncome < 20000 Then
grossTax = 0
ElseIf totalTaxableIncome >= 20000 _
And totalTaxableIncome <= 50000 Then
grossTax = totalTaxableIncome * 0.18
ElseIf totalTaxableIncome > 50000 _
Or totalTaxableIncome <= 100000 Then
grossTax = totalTaxableIncome * 0.22
Else
grossTax = totalTaxableIncome * 0.28
End If
taxDue = grossTax - totalDependTaxCredit - totalRandomTaxCredit
If taxDue < 0 Then
taxDue = 0
End If
taxDue = Round(taxDue)
Cells(25, 2) = taxDue
  
'Payments
taxWithheld = Cells(28, 2)
guilt = Cells(29, 2)
totalPayments = Round(taxWithheld + guilt)
Cells(30, 2) = totalPayments
  
'Who owes whom
If taxDue = totalPayments Then
owedMessage = "We're square"
owed = 0
ElseIf taxDue > totalPayments Then
owedMessage = "You owe us"
owed = taxDue - totalPayments
Else
owedMessage = "We owe you"
owed = totalPayments - taxDue
End If
Cells(32, 1) = owedMessage
Cells(32, 2) = owed
End Sub

Taxable income Rate Under 20,000 0% 20,000 to 50,000 18% 50,001 to 100,000 22% Above 100,000 28% 2 1 Form 1041.6.llama 2 Individual Income Tax Return 4 Income 5 Wages 6 Investments 7 Imaginary 8 Beauty benefit 9 Taxable income 10 11 Dependents 12 Humans (number of) 13 Dogs (number of) 14 Cats (number of) 15 Dependents tax credit 16 17 Random credits 18 Education expenses 19 Jean jackets 20 Charitable donations 21 74000 120 48000 4000 89320 5050 2000 1000 Actual 400 2000 1100 What you tell your mother 23 Random tax credit 24 25 Tax due 26 27 Payments 28 Tax withheld 29 Unearned guilt 30 Total payments 31 32 We owe you 13500 16280 50 16330 Run

Explanation / Answer

Option Explicit

Private Sub cmdRun_Click()
'Income
Dim incomeWages As Single
Dim taxableWages As Single
Dim incomeInvestments As Single
Dim incomeImaginary As Single
Dim taxableImaginary As Single
Dim incomeBeauty As Single
Dim taxableBeauty As Single
Dim totalTaxableIncome As Single
'Dependents
Dim numHumans As Integer
Dim numDogs As Integer
Dim numCats As Integer
Dim dependCreditHumans As Single
Dim dependCreditDogs As Single
Dim dependCreditCats As Single
Dim totalDependTaxCredit As Single
'Random
Dim educationalExpenses As Single
Dim creditEducational As Single
Dim jeanJacketExpenses As Single
Dim creditJeanJackets As Single
Dim charitableActual As Single
Dim charitableMother As Single
Dim creditCharitable As Single
Dim totalRandomTaxCredit As Single
'Payments
Dim taxWithheld As Single
Dim guilt As Single
Dim totalPayments As Single
'Final calculation
Dim grossTax As Single
Dim taxDue As Single
Dim owedMessage As String
Dim owed As Single
  
'Compute taxable income
'Get input
incomeWages = Cells(5, 2)
incomeInvestments = Cells(6, 2)
incomeImaginary = Cells(7, 2)
incomeBeauty = Cells(7, 2)
'Wages
If incomeWages <= 50000 Then
taxableWages = 40000 '50000 * 0.8
Else
taxableWages = 40000 + (incomeWages - 50000)
End If
'Imaginary
If incomeImaginary <= 100000 Then
taxableImaginary = incomeImaginary * 0.4
Else
taxableImaginary = 100000 * 0.4 _
+ (incomeImaginary - 100000) * 0.7
End If
'Beauty benefit
taxableBeauty = incomeBeauty * 1.5
'Total taxable income
totalTaxableIncome = Round(taxableWages + incomeInvestments _
+ taxableImaginary + taxableBeauty)
Cells(9, 2) = totalTaxableIncome
  
'Dependents
numHumans = Cells(12, 2)
numDogs = Cells(13, 2)
numCats = Cells(14, 2)
'Humans credit
If numHumans <= 4 Then
dependCreditHumans = numHumans * 1000
Else
dependCreditHumans = 4000
End If
'Dogs credit
dependCreditDogs = 0
If numDogs = 1 Then
dependCreditDogs = 1300
Else
dependCreditDogs = 3000
End If
'Cats credit
dependCreditCats = 0
If numCats >= 1 Then
dependCreditCats = 50
End If
totalDependTaxCredit = Round(dependCreditHumans _
+ dependCreditDogs + dependCreditCats)
Cells(15, 2) = totalDependTaxCredit
  
'Random
educationalExpenses = Cells(18, 2)
jeanJacketExpenses = Cells(19, 2)
charitableActual = Cells(21, 2)
charitableMother = Cells(22, 2)
creditEducational = educationalExpenses * 0.5
creditJeanJackets = jeanJacketExpenses * 0.1
creditCharitable = 0
If charitableMother < charitableActual Then
creditCharitable = charitableActual * 0.4
End If
totalRandomTaxCredit = Round(creditEducational _
+ creditJeanJackets + creditCharitable)
Cells(23, 2) = totalRandomTaxCredit
  
'Compute tax due
If totalTaxableIncome < 20000 Then
grossTax = 0
ElseIf totalTaxableIncome >= 20000 _
And totalTaxableIncome <= 50000 Then
grossTax = totalTaxableIncome * 0.18
ElseIf totalTaxableIncome > 50000 _
Or totalTaxableIncome <= 100000 Then
grossTax = totalTaxableIncome * 0.22
Else
grossTax = totalTaxableIncome * 0.28
End If
taxDue = grossTax - totalDependTaxCredit - totalRandomTaxCredit
If taxDue < 0 Then
taxDue = 0
End If
taxDue = Round(taxDue)
Cells(25, 2) = taxDue
  
'Payments
taxWithheld = Cells(28, 2)
guilt = Cells(29, 2)
totalPayments = Round(taxWithheld + guilt)
Cells(30, 2) = totalPayments
  
'Who owes whom
If taxDue = totalPayments Then
owedMessage = "We're square"
owed = 0
ElseIf taxDue > totalPayments Then
owedMessage = "You owe us"
owed = taxDue - totalPayments
Else
owedMessage = "We owe you"
owed = totalPayments - taxDue
End If
Cells(32, 1) = owedMessage
Cells(32, 2) = owed
End Sub