1. Create a class named TaxCalculator with the following: a. A double data type variable named "annuallncome". b. A double data type array containing the following values in this order: 0, .1, .15,...


Use java code to complete


1. Create a class named TaxCalculator with the following:<br>a. A double data type variable named

Extracted text: 1. Create a class named TaxCalculator with the following: a. A double data type variable named "annuallncome". b. A double data type array containing the following values in this order: 0, .1, .15, .23, .28, .33, .35 C. A method which takes annual income as a parameter and prints the tax calculated as per the below tax bracket: i. Tax brackets: Tax Bracket 0 : Income <= 0="" tax="" bracket="" 1:0="">< income=""><= 9999="" tax="" bracket="" 2:9999="">< income=""><= 39999="" tax="" bracket="" 3:="" 39999="">< income=""><= 89999="" tax="" bracket="" 4:="" 89999="">< income=""><= 189999="" tax="" bracket="" 5:="" 189999="">< income=""><= 399999="" tax="" bracket="" 6:="" 399999="">< income="" conditionally="" check="" 1="" of="" the="" 8="" different="" income="" brackets="" given="" above="" to="" find="" where="" the="" user's="" income="" falls.="" ii.="" iii.="" assume="" the="" array="" elements="" (from="" 1.b="" above)="" match="" with="" these="" income="" brackets="" sequentially="" (i.e,="" if="" your="" bracket="" is="" 0="">< income=""><= 9999 then the tax rate is .1, which is the 2nd element in your array), calculate and print the amount of tax they will pay - where a users' tax will is calculated as annual income * tax rate iv. for example, if annual income is $200,000, which falls in tax bracket 5, then tax rate would be .33 & therefore the tax paid would be $66,000... ouch! 2. create another class taxcalculatordemo. in that: a. make an object of taxcalculator class. b. take annual income as input from the user and set to object's annuallncome and print the total tax to be paid. c. use try...catch block while taking the user's annual income and if the user enters a “non-double" input (like string), then print “invalid income entered". d. show output for valid and invalid user entry. 9999="" then="" the="" tax="" rate="" is="" .1,="" which="" is="" the="" 2nd="" element="" in="" your="" array),="" calculate="" and="" print="" the="" amount="" of="" tax="" they="" will="" pay="" -="" where="" a="" users'="" tax="" will="" is="" calculated="" as="" annual="" income="" *="" tax="" rate="" iv.="" for="" example,="" if="" annual="" income="" is="" $200,000,="" which="" falls="" in="" tax="" bracket="" 5,="" then="" tax="" rate="" would="" be="" .33="" &="" therefore="" the="" tax="" paid="" would="" be="" $66,000...="" ouch!="" 2.="" create="" another="" class="" taxcalculatordemo.="" in="" that:="" a.="" make="" an="" object="" of="" taxcalculator="" class.="" b.="" take="" annual="" income="" as="" input="" from="" the="" user="" and="" set="" to="" object's="" annuallncome="" and="" print="" the="" total="" tax="" to="" be="" paid.="" c.="" use="" try...catch="" block="" while="" taking="" the="" user's="" annual="" income="" and="" if="" the="" user="" enters="" a="" “non-double"="" input="" (like="" string),="" then="" print="" “invalid="" income="" entered".="" d.="" show="" output="" for="" valid="" and="" invalid="" user="">
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here