Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help writing this test. Once answered can you show that the test actually passes. Thanks The Trickiest Tax of Them Al Follow the RED,

need help writing this test. Once answered can you show that the test actually passes. Thanks image text in transcribed
The Trickiest Tax of Them Al Follow the RED, GREEN, REFACTOR mantra on your own and use problem one last test. Follow the Here nosition to make It manageable: rhis is a single income tax with three tax levels: 19, 999.99: 08 20,000 39.999.99: 58 40,000 and up: 10 gets a 1000 deduction per dependent it also includes these special instructions: the middle tax group, if their mortgage interest is ore than 28 of their adjusted income, they can deduct it fr that adjusted income foc the top tax bracket, 1f their total deductions are more than 10% of their income, they pay taxes on their entire income .The parameters to specialTaxLaws are income .number of dependents mortgage interest paid Test public void testspecialTaxLaws() TaxCalculator ctnew TaxCalculator // test the border between the first two brackets assertEquals(0, ct.specialTaxLaws (22999.99, 3, 0.0), 0.001): asseztEquais 120000 0.05, et.specialTaxlaws (24000.00, 4, 0.0), 0.001): // test the border between the top two brackets assertEquals (39999.99 0.05, ct.specialTaxLaws (41999.99, 2, 0.0), 0.001) assertEquals(40000 * 0.10, ct . specialTaxLaws (43000, 3, 0.0), 0.001); // in the middle bracket, we also need to test the border / for mortgage interest assertEquals (30000*0.05, ct . specialTaxLaws (30000, (30000 0.02+ 0.01))0.05, 0, 30000.0.02), .001) assertEquals ( (30000 ct.specialTaxLaws (30000, 0, 30000 0.02+0.01), 0.001) // also, do one with dependents to make sure it's comparing / with the adjusted income assertEquals ( (30000 (30000 0.02+0.01)) 0.05, ct . specialTaxLaws (31000, 1, 30000*0.02+0.01), 0.001); in the top bracket, we also need to test the border of / the alternate minimum tax assertEquals ( (100000 10000) +0.10, ct: special7axLaws (100000, 10, 0.0), 0.001) i ct.specialTaxiavs (99999.99, 10, 0.0), 0.001) assertEquals (99999.99 * 0.10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions