How to calculate the discount price

Posted by Chaithragm under C# on 8/16/2013 | Points: 10 | Views : 9021 | Status : [Member] | Replies : 1
How to calculate the Discount price for example

In a shop their will be different discounts for the purchased things
1)if we purchased T-shirt (20%)
2)if we purchase Pant (30%)

how to calculate the the cost of the shirt after giving the discount ?




Responses

Posted by: Bandi on: 8/16/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down

public int CalculateTotal(discount int, Actualprice int)

{
int total = 0;
total = Actualprice - ((Actualprice*discount)/100); -- calculation of total amount after discount

return total;
}


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response