Question: Language is python, how would one do this program? Is it tax time again? Yup, as usual I forgot all about it, and now I

Language is python, how would one do this program?

Is it tax time again? Yup, as usual I forgot all about it, and now I remember I owe somebody something. But how much? Thats never an easy answer, but this time they gave me a simple mathematical formula (not the real one the IRS uses of course) and wished me luck figuring it out on my own! Thanks guys!

Presume integer values for the T, I, and A variables described in the following. Take the taxes you owe the government, call it T, and set it equal to zero. Take your income (your function input) and call it I. ***If I is less than $200, then you are done computing, and you owe T (your function output) to the government. But if I is $200 or more, then compute value ((I / 5) 40) and call it A. Add A to T. Set I to A. Finally, return this train of logic to the *** listed above and repeat the process again.

Here are some example inputs and their expected result values:

INCOME TAXES OWED ------ ---------- 0 0 2000 392 4000 872 6000 1352 8000 1846 10000 2342 12000 2838 14000 3334 16000 3830 18000 4326 20000 4822 22000 5318 24000 5814 26000 6310 28000 6806 30000 7302

  1. Using the previous description, develop a function that returns the taxes due for a given income:
  • int TaxesOwed(int Income) // C++, Java, C# syntax
  • def TaxesOwed(Income) # Python syntax

  1. Develop code in a main function that uses the TaxesOwed function to compute the total taxes owed for a person who had five incomes
  • Create an array/vector/list/tuple of integer values that represents incomes
    • Use these exact values
    • [16264, 13954, 11547, 6415, 3187]
  • For each income element in the collection, compute its taxes owed
  • Display the sum of the taxes owed for this collection of data
    • [3894 + 3322 + 2724 + 1452 + 676] = 12068

  1. Develop code in a main function that uses the TaxesOwed function to compute the total taxes owed to the government for a big group of people
  • Process the attached file (incomes.txt) that contains many incomes
    • You must open the file, process the data, and close the file programmatically
    • You may not simply copy the values from the file into your programs source code
  • Create the collection of integer values that represents incomes
  • For each income element in the array, compute its taxes owed
  • Display the sum of the taxes owed for this array of data
    • 853931 is correct for the attached data file

  1. As a comment near the top of your source code, answer the following question:
  • As income input values approach infinity, what is the tax rate percentage owed to the government?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!