It is not a hard problem if the instructor would allow me to use IF OR LOOP etc statements to do..
here is the assigment
the 2009 federal income tax rates for single filing status is given below
$0-8350 10%
$8350-$33950 15%
$33950-$82250 25%
$82250-$171550 28%
$171550-$372950 33%
$372950- 35%
for example, a single tax payer with $50000 taxable income would have pay 8350*10%+(33950-8350)*15%+(50000-33950)*25% = $8688
write a java program to perform the tax calculations. Use a JOptionPane dialog box to prompt the user to enter the taxable income as an integer. Calculate the tax according to the above table. Display the tax, rounded to the nearest dollars, in another JoptionPane dialog box.
Use only the java features bla bla... donot use any statements introduced in later chapters ( such as the if or loop statements).
Any idea?
我想了两天也没有想出来用什么数学方法能解决这个问题哦。。。有没有高手能指教一二。
need help for a java problem
所有跟帖:
•
Is this the right place to post a question like this?
-535897932384626-
♂
(0 bytes)
()
02/03/2009 postreply
14:21:52
•
so you cant use "if", can you use "switch/case"?
-535897932384626-
♂
(0 bytes)
()
02/03/2009 postreply
14:23:54
•
yah i'd say the CASE statement would have to be it
-panzerkom-
♂
(0 bytes)
()
02/03/2009 postreply
14:56:17
•
what about use "a>b?fun1:func1" kinds of statement?
-中餐霸费-
♂
(197 bytes)
()
02/03/2009 postreply
14:31:27
•
external function is a quick way to get her ass kicked by the pr
-panzerkom-
♂
(0 bytes)
()
02/03/2009 postreply
14:51:32
•
you sure "IF" is not allowed?! that's the foundation of any ...
-panzerkom-
♂
(236 bytes)
()
02/03/2009 postreply
14:55:18