Write a VBA Function subroutine called Tax that takes a single argument grossIncome of type Currency. It should calculate the tax on any income using the following tax schedule: (1) if income is less than or equal to $15,000, there is no tax (2) if income is greater than $15,000 and less than or equal to $75,000, the tax is 15% of all income greater than $15,000 (3) if income is greater than $75,000, the tax is 15% of all income between $15,000 and $75,000 plus 20% of all income greater than $75,000   Then write a CalcTax subroutine that asks the user for his income, gets the function subroutine to calculate the tax on this income, and reports the tax in a message box.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 13E
icon
Related questions
Question

Write a VBA Function subroutine called Tax that takes a single argument grossIncome of type Currency. It should calculate the tax on any income using the following tax schedule:

(1) if income is less than or equal to $15,000, there is no tax

(2) if income is greater than $15,000 and less than or equal to $75,000, the tax is 15% of all income greater than $15,000

(3) if income is greater than $75,000, the tax is 15% of all income between $15,000 and $75,000 plus 20% of all income greater than $75,000

 

Then write a CalcTax subroutine that asks the user for his income, gets the function subroutine to calculate the tax on this income, and reports the tax in a message box.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

I understand everything except for where the $60,000 came from on the last Else line. How did you get that?

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning