第六章第十五题(金融应用:打印税表)(Financial application: print a tax table)
*6.15(金融应用:打印税表)程序清单3-5给出了计算税款的程序。使用税款的程序。使用下面的方法头编写一个计算税款的方法: public static double computeTax(int status,double taxableIncome) 使用这个方法编写程序,打印可征税收人从50000美元到60000美元,收入间隔为50美元的所有以下婚姻状态的纳税表,如下所示: Taxable Single Married Joint Married Head of Income or Qualifying Separate House hold Widow(er) 50000 8688 6665 8688 7353 50050 8700 6673 8700 7365 … 59950 11175 8158 11175 9840 60000 11188 8165 11188 9853 提示:使用Math.round(即Math.round(computeTax(status,tabableIncome)))将税收舍入为整数。 *6.15(Financial application: print a tax table) Listing 3.5 gives a program to compute tax. Write a method for computing tax using the following header: public static double computeTax(int status, double taxableIncome) Use this method to write a program that prints a tax table for taxable income from $50,000 to $60,000 with intervals of $50 for all the following statuses: Taxable Single Married Joint Married Head of Income or Qualifying Separate House hold Widow(er) 50000 8688 6665 8688 7353 50050 8700 6673 8700 7365 … 59950 11175 8158 11175 9840 60000 11188 8165 11188 9853 Hint: round the tax into integers using Math.round (i.e., Math .round(computeTax(status, taxableIncome))).
Taxable Single Married Joint Married Head of
Income or Qualifying Separate House hold
Widow(er)----------------------------------------------------------------------------------500008688666586887353500508700667387007365501008713668087137378501508725668887257390502008738669587387403502508750670387507415503008763671087637428503508775671887757440504008788672587887453504508800673388007465505008813674088137478505508825674888257490506008838675588387503506508850676388507515507008863677088637528507508875677888757540508008888678588887553508508900679389007565509008913680089137578509508925680889257590510008938681589387603510508950682389507615511008963683089637628511508975683889757640512008988684589887653512509000685390007665513009013686090137678513509025686890257690514009038687590387703514509050688390507715515009063689090637728515509075689890757740516009088690590887753516509100691391007765517009113692091137778517509125692891257790518009138693591387803518509150694391507815519009163695091637828519509175695891757840520009188696591887853520509200697392007865521009213698092137878521509225698892257890522009238699592387903522509250700392507915523009263701092637928523509275701892757940524009288702592887953524509300703393007965525009313704093137978525509325704893257990526009338705593388003526509350706393508015527009363707093638028527509375707893758040528009388708593888053528509400709394008065529009413710094138078529509425710894258090530009438711594388103530509450712394508115531009463713094638128531509475713894758140532009488714594888153532509500715395008165533009513716095138178533509525716895258190534009538717595388203534509550718395508215535009563719095638228535509575719895758240536009588720595888253536509600721396008265537009613722096138278537509625722896258290538009638723596388303538509650724396508315539009663725096638328539509675725896758340540009688726596888353540509700727397008365541009713728097138378541509725728897258390542009738729597388403542509750730397508415543009763731097638428543509775731897758440544009788732597888453544509800733398008465545009813734098138478545509825734898258490546009838735598388503546509850736398508515547009863737098638528547509875737898758540548009888738598888553548509900739399008565549009913740099138578549509925740899258590550009938741599388603550509950742399508615551009963743099638628551509975743899758640552009988744599888653552501000074531000086655530010013746010013867855350100257468100258690554001003874751003887035545010050748310050871555500100637490100638728555501007574981007587405560010088750510088875355650101007513101008765557001011375201011387785575010125752810125879055800101387535101388803558501015075431015088155590010163755010163882855950101757558101758840560001018875651018888535605010200757310200886556100102137580102138878561501022575881022588905620010238759510238890356250102507603102508915563001026376101026389285635010275761810275894056400102887625102888953564501030076331030089655650010313764010313897856550103257648103258990566001033876551033890035665010350766310350901556700103637670103639028567501037576781037590405680010388768510388905356850104007693104009065569001041377001041390785695010425770810425909057000104387715104389103570501045077231045091155710010463773010463912857150104757738104759140572001048877451048891535725010500775310500916557300105137760105139178573501052577681052591905740010538777510538920357450105507783105509215575001056377901056392285755010575779810575924057600105887805105889253576501060078131060092655770010613782010613927857750106257828106259290578001063878351063893035785010650784310650931557900106637850106639328579501067578581067593405800010688786510688935358050107007873107009365581001071378801071393785815010725788810725939058200107387895107389403582501075079031075094155830010763791010763942858350107757918107759440584001078879251078894535845010800793310800946558500108137940108139478585501082579481082594905860010838795510838950358650108507963108509515587001086379701086395285875010875797810875954058800108887985108889553588501090079931090095655890010913800010913957858950109258008109259590590001093880151093896035905010950802310950961559100109638030109639628591501097580381097596405920010988804510988965359250110008053110009665593001101380601101396785935011025806811025969059400110388075110389703594501105080831105097155950011063809011063972859550110758098110759740596001108881051108897535965011100811311100976559700111138120111139778597501112581281112597905980011138813511138980359850111508143111509815599001116381501116398285995011175815811175984060000111888165111889853
Process finished with exit code 0