This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi there, i hope u ppl r doin' fine.mu question is taht suppose if i have int=200000 then from it on first 50000 there should be no tax ,given below: 200000-50000=0 tax 150000-20000=10% tax 130000-30000=20% tax 100000-50000=25% tax 50000 30% tax
i tried a little so the programme given below:
i hope u ppl will help me out. take care with regards kumar abhay
[This message has been edited by Marilyn deQueiroz (edited November 06, 2001).]
To start out lets unconfuse things. The number of zeros in the definitions seems to be incorrect. You have: 200,000 to 50,000 = no tax I assume you mean 20,000 to 50,000 = no tax And than the next line you say: 100,000 to 20,000 = 10% tax Which is confusing in more than one way. Is the value of 100,000 a typo for 10,000? Even accounting for typos the ranges don't match up. In the code you have variable names like e, f, g which are never used. I know that it isn't a large program but is doesn't help when you are trying to read the code. You also need to use curly brackets for your ifs. Give it another try and post back again, thanks.
Please ignore post, I have no idea what I am talking about.
Kumar, Is this the taxation scheme you are trying to explain? first 50000, no tax next 20000 (amount from 50001 to 70000), taxed at 10% next 30000 (amount from 70001 to 100000), taxed at 20% next 50000 (amount from 100001 to 150000), taxed at 25% remainder (amount from 150001 and above), taxed at 30% If this is the case, try using an appropriate loop and two arrays: one to hold the scale, one to hold the corresponding percentages. I'm giving you a hint only in case this is a class assignment. HTH, Junilu