Click here to Skip to main content
15,867,906 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to calculate sales tax with product cost 30 and pay 10.3% tax what is the actual amount
Posted
Comments
Smithers-Jones 19-Nov-11 5:24am    
Your question has nothing to do with programming. If you can't even do that simple calculation, maybe you should consider another career.
Sergey Alexandrovich Kryukov 19-Nov-11 18:52pm    
Better earlier than never :-)
--SA
srinivas vadepally 19-Nov-11 5:24am    
Is this maths class?

1 solution

Try something like
C#
float product = 30.0;
float tax= 10.3;
float actualcost = product - (product * tax / 100); //actualcost contains the actual amount


You might want to round the solution off to two decimal places.
 
Share this answer
 
Comments
thatraja 19-Nov-11 5:31am    
Hey you, I'm going to throw you more homework questions

Only 4!
Abhinav S 19-Nov-11 5:33am    
Ok Sorry.
No more answers to homework questions.
thatraja 19-Nov-11 5:38am    
OK, I re-vote now. 5!
:)
Abhinav S 19-Nov-11 7:26am    
Thanks.
Smithers-Jones 19-Nov-11 5:33am    
Good answer Abhinav, but I think, if OP can't even do this simple calculation, he is clearly not made for programming. Did you see his other "question" about medical billing software. He is working on medical software and has no clue on how to calculate some simple percentage??? At the moment it's only billing software, but imagine him working on some more critical medical stuff. People's health or even lifes might depend on the output of his software.
Got my 5 anyway.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900