Question: Java A ResidentTaxPayer has the following attributes: - TFN (an id) name - state A NonResidentTaxPayer has the following attributes TFN (an id) name country
Java


A ResidentTaxPayer has the following attributes: - TFN (an id) name - state A NonResidentTaxPayer has the following attributes TFN (an id) name country 1. Create two classes, a ResidentTaxPayer class and a NonResidentTaxPayer. Include attributes and a constructor that sets all attributes. 2. Add a caleTax method into both classes. A ResidentTaxPayer has a tax free threshold of 20,000. After that 30% tax is payable. A NonResidentTaxPayer has no tax free threshold and 33% tax is payable. 3. Add a print method into both classes that prints to the console all attributes and the tax payable (by calling the calcTax method). Write test code in your program's main method that creates a single ResidentTaxPayer object then calls its print method. Next add test code that creates a single NonResidentTaxPayer object then calls its print method. 4. Add more test code into your main method: create a list for each tax payer class, then add objects into those two lists, then prints the content of the two lists. Remember you will need to add an include statement for java.util. at the top. Recall the syntax for declaring and creating an empty Array List of TaxPayer is: ArrayList TaxPayer payers -new ArrayLists TaxPayer 0: Recall to add a TaxP ayer object into your pavers list use payers.add . a TaxPayer object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
