作者hankhank5345 (MPower)
看板C_and_CPP
標題[問題] C++問題
時間Fri Feb 20 07:13:19 2009
這題小弟想很久但還是不會用function來寫,請問誰可以幫個忙?
write a function that has an double as a parameter
and returns a double through the function call.
The parameter is the income for a single person and
the return value is the amount of income tax owed.
Use the "Schedule X- single" table below.
Write a main function to test the function you have written.
You are REQUIRED to use nested if... else if....else if.....else
to determain the caluclation to use for the tax.
Schedule X- Single
If taxable But not over The Tax is
income is
Over--
$0 $7550 10% of the amount over $0
$7550 $30650 $755 plus 15% of the amount over 7550
$30650 $74200 $4220.00 plus 25% of the amount over 30650
$74200 $154800 $15107.50 plus 28% of the amount over 74200
$154800 $336550 $37657.50 plus 33% of the amount over 154800
$336550 $ no limit $97653.00 plus 35% of the amount over 336550
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 71.199.79.106
推 smallworld:我還以為是要parse這張表 = =A 02/20 11:46
→ StubbornLin:我還以為這是發包的價錢 XD 02/20 12:52