begintabularll hline multicolumn1c Income multicolumn1c Tax for Single

Write a program in Thonny that will calculate income tax owed given wages, taxable interest, unemployment compensation, status (single or married) and taxes withheld. Taxpayers are only allowed to use this short form if adjusted gross income (AGI) is less than $120,000. Dollar amounts are displayed as integers with comma separators. For example, print(f"Deduction: ${deduction:,}").Hint – it will be one program but build this program in steps.Step 1 – Get Input - You will input wages, taxable interest, unemployement compensation, status (1=single and 2=married) and taxes withheld as integers.Step 2 – Calculate AGI - You are to calculate the adjusted gross income (AGI). It is calculated as wages + interest + unemployement. Output error message if the AGI is above $120,000 and the program stops with no additional output.Step 3 - Identify Deduction Amt - deduction amount based on status: (1) Single=$12,000 or (2) Married=$24,000. Set status to 1 if not input as 1 or 2. Calculate taxable income (AGI - deduction). Set taxable income to zero if negative.Step 4 – Calculate Tax Amount - Calculate tax amount based on exemption and taxable income (see tables below). Tax amount should be stored as a double and rounded to the nearest whole number using round().Step 5 – Calculate Tax Due or Refund - Calculate amount of tax due (tax - withheld). If the amount due is negative the tax payer receives a refund. Output tax due or tax refund as positive values You will be running the program with inputs based on your student number. You will divide your student number by 100 to get the amount for wages for run 1. For run 2, you would add $10,000Eg – my student number is 5921362, then my wages are $59,213 for run 1, and $69,213 for run 2.Run your program twice using the numbers in the table above, but replace the Wages with the wage based on your student number (student number / 100, student number / 100 + 10000).

Write a program in Thonny that will calculate income tax owed given wages, taxable interest, unemployment compensation, status (single or married) and taxes withheld. Taxpayers are only allowed to use this short form if adjusted gross income (AGI) is less than $120,000. Dollar amounts are displayed as integers with comma separators. For example, print(f”Deduction: ${deduction:,}”).Hint – it will be one program but build this program in steps.Step 1 – Get Input – You will input wages, taxable int

Read More

Write a Python function that takes as input three integers MN and r and returns an MN matrix of

Write a Python function that takes as input three integers, M, N, and r, and returns an MN matrix of rank r. Create matrices of different sizes and ranks, and use numpy.linalg.matrix_rank() to verify the returned matrices have the desired rank. Why should you expect a randomly generated matrix to have the rank you prescribe? What happens if you set r > min(M, N), and why does that happen? def randrank(M, N, r): A = random.randn(M, r) B = random.randn(N, r) return A.dot(B.T) R = randrank(32, 41, 7) print(R.shape, 'n') print(LA.matrix_rank(R), 'n') (32, 41) 7 (a) Use the function in Exercise #1 to generate a 5020 random matrix of rank r = 20, and visualize it. (b) Find the SVD of the matrix in part (a) using numpy.linalg.svd(). (c) Reconstruct the MN 2D array s with the entries of along its diagonal and zeros everywhere else: S = [s100000, s200000, sN00] if M > N, or S = [s1000, s2000, sM000000] if M < N (d) Verify that U.dot(S.dot(Vt)) recovers the matrix created in part (a). (e) Repeat (a) - (d) for a randomly generated 2050 matrix of rank r = 20.

Write a Python function that takes as input three integers, M, N, and r, and returns an MN matrix of rank r. Create matrices of different sizes and ranks, and use numpy.linalg.matrix_rank() to verify the returned matrices have the desired rank. Why should you expect a randomly generated matrix to have the rank you prescribe? What happens if you set r > min(M, N), and why does that happen? def randrank(M, N, r): A = random.randn(M, r) B = random.randn(N, r) return A.dot(B.T) R = rand

Read More

Write a program that determines the total amount for a set of tickets based off the following

Write a program that determines the total amount for a set of tickets based on the following prices. Create a function that accepts the class type (as its letter) and the number of tickets of that class. The function should return the total price for that number of tickets. The main function should ask the user for the number of tickets of each type that was purchased and then call the function for each ticket type to calculate the subtotal of each type. The total price should be outputted in the main function.

Write a program that determines the total amount for a set of tickets based on the following prices. Create a function that accepts the class type (as its letter) and the number of tickets of that class. The function should return the total price for that number of tickets. The main function should ask the user for the number of tickets of each type that was purchased and then call the function for each ticket type to calculate the subtotal of each type. The total price should be outputted in th

Read More

You are working on problem set Unit 4 Task Coding Part 1 OPause medianof3 0 LanguageType

You are working on problem set: Unit 4 - Task| Coding Part 1 (Pause) median_of_3 Language/Type: Python Errors: if/else return string The following function attempts to return the median (middle) of three integer values, but it contains logic errors. In what cases does the function return an incorrect result? How can the code be fixed? Determine what is wrong with the code, and submit a corrected version that works properly. def median_of_3(n1, n2, n3): if n1 < n2: if n2 < n3: return n2 else: return n3 else: if n1 < n3: return n1 else: return n3

You are working on problem set: Unit 4 – Task| Coding Part 1 (Pause) median_of_3 Language/Type: Python Errors: if/else return string The following function attempts to return the median (middle) of three integer values, but it contains logic errors. In what cases does the function return an incorrect result? How can the code be fixed? Determine what is wrong with the code, and submit a corrected version that works properly. def median_of_3(n1, n2, n3): if n1 < n2: if n2 < n

Read More

Please design and code a Python program that will solve a problem Any problem is ok Please

Please design and code a Python program that will solve a problem (Any problem is ok). Please include arrays, Stacks and Queues, Linked Lists, Binary Trees, AVL and Red-Black Trees, and Hash Tables in the program.Please prepare a PowerPoint file that describes at a very high level (no technical) the project. The audience of this file will be non-technical people but interested to hear what kind of problems your project will solve.

Read More

Write a C program that uses scanf to read in rows and columns and declares a 2D array using those

Write a C program that uses scanf to read in rows and columns and declares a 2D array using those values. The main program also uses scanf to read in the values to store in the 2D array. Then, create a function Transpose to print both the original matrix and the transpose of the matrix. NOTE: The transpose of a matrix is an operator which flips a matrix over its diagonal, i.e., it switches the row and column indices of the matrix. This matrix: 492 715 382 After being transposed, becomes this matrix: 473 918 252 Output example:

Write a C program that uses scanf to read in rows and columns and declares a 2D array using those values. The main program also uses scanf to read in the values to store in the 2D array. Then, create a function Transpose to print both the original matrix and the transpose of the matrix. NOTE: The transpose of a matrix is an operator which flips a matrix over its diagonal, i.e., it switches the row and column indices of the matrix. This matrix: 492 715 382 After being transposed, becomes this mat

Read More

1 The Collatz sequence is generated with the following algorithm Start with an integer n If n is

The Collatz sequence is generated with the following algorithm. 1. Start with an integer n. 2. If n is even, divide by 2. 3. If n is odd, multiply by 3 and add 1. 4. Repeat this process with the new value of n, terminating when n = 1. For example, starting with n = 11, the following sequence of numbers will be generated: 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. Write a MIPS program that prompts the user to enter the starting value n and prints the Collatz sequence. An example run is shown below: Enter starting n = 22 Bonus: Implement a recursive version of the Collatz program without using any loops.

The Collatz sequence is generated with the following algorithm. 1. Start with an integer n. 2. If n is even, divide by 2. 3. If n is odd, multiply by 3 and add 1. 4. Repeat this process with the new value of n, terminating when n = 1. For example, starting with n = 11, the following sequence of numbers will be generated: 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. Write a MIPS program that prompts the user to enter the starting value n and prints the Collatz sequence. An example run i

Read More