[問題] C++問題
看板C_and_CPP (C/C++)作者hankhank5345 (MPower)時間16年前 (2009/02/20 07:13)推噓1(1推 0噓 1→)留言2則, 2人參與討論串1/3 (看更多)
這題小弟想很久但還是不會用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
推
02/20 11:46, , 1F
02/20 11:46, 1F
→
02/20 12:52, , 2F
02/20 12:52, 2F
討論串 (同標題文章)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章