+ 1
How to calculate amount and discount in a java program?
5 Answers
+ 3
Assuming the discount is in percentage:
double amount = price * (discount / 100.0);
Say discount is 50.0%
50.0 / 100.0 = 0.5;
Say the price is $120.00;
120.00 * 0.5 = 60.00
Therefore,
amount = $60.00.
I assume this isn't the answer you are looking for (hopefully it is though!) In which case, please clarify the question further. Most people likely do not want to write entire programs for you.
+ 3
Whatever the original price is, excluding discount. Selling price.
+ 1
thanks for the answer...you are right this is not the answer but might work for me....I will be more specific... thanks đ
+ 1
wait double amount = price*(discount/100.0)?
+ 1
what price? selling price or cost price?