Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 6 - Functions - Programming Exercises - Page 206: 6.15

Answer

code

Work Step by Step

# 6.15 (Financial application: print a tax table) Listing 4.7, ComputeTax.py, gives a # program to compute tax. Write a function for computing tax using the following # header: # def computeTax (status, taxableIncome ): # Use this function to write a program that prints a tax table for taxable income from # $50,000 to $60,000 with intervals of $50 for all four statuses, as follows: # Taxable Single Married Married Head of # Income Joint Separate a House # 50000 8688 6665 8688 7352 # 50050 8700 6673 8700 7365 # ... # 59950 11175 8158 11175 9840 # 60000 11188 8165 11188 9852 from CH6Module import MyFunctions print("Taxable\t\tSingle\t\tMarried\t\tMarried\t\tHead of") print("Income\t\t\t\t\tJoint\t\tSeparate\ta House") for i in range(50000, 60001, 50): print(i, "\t ", MyFunctions.computeTax(0, i), "\t", MyFunctions.computeTax(1, i), "\t", MyFunctions.computeTax(2, i), "\t", MyFunctions.computeTax(3, i))
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.