You need to sign in to do that
Don't have an account?
Kumar Santosh 17
How to write an apex program when Bill amount and Discount given. print the net amount after discount.
How to write an apex program when Bill amount and Discount given as follows
Bill amount value Discount(%)
1000 - 5000 5%
5001 - 10000 10%
print the net amount to pay(After Discount)
Bill amount value Discount(%)
1000 - 5000 5%
5001 - 10000 10%
print the net amount to pay(After Discount)
if (VariableName.Bill_Amount__c => 1000 && VariableName.Bill_Amount__c <=5000) {
VariableName.Bill_Amount__c = VariableName.Bill_Amount __c - (VariableName.Bill_Amount__c * 0.05);
system.debug ('The Net Amount After Discount is ' + VariableName.Bill_Amount__c);
}
else
if (VariableName.Bill_Amount__c => 5001 && VariableName.Bill_Amount__c <=10000) {
VariableName.Bill_Amount__c = VariableName.Bill_Amount __c - (VariableName.Bill_Amount__c * 0.1);
system.debug ('The Net Amount After Discount is ' + VariableName.Bill_Amount__c);
}