write an algorithm to find average price of mangoes purchased by hari ram from a buyer 1 at rupees per kg with 5% discount and from buyer 2 at rupees 100 per kg with 5% discount.he purchased 10 kg from buyer 1 and 20 kg from buyer 2. also find the the total discounted amount.
1. set total_amount equal 0
2. set total_cost equal 0
3. set total_discount equal 0
4. set amount1 equal 10
5. set price1 equal 120
6. set discount1 to 5
7. set payment equal amount1*price1
8. increase total_amount by amount1
9. increase total_price by payment*(1-discount1/100)
10. increase total_discount by payment*discount1/100
11. set amount2 equa 20
12. set price2 equal 100
13. set discount2 to 5
14. set payment equal amount2*price2
15. increase total_amount by amount2
16. increase total_price by payment*(1-discount2/100)
17. increase total_discount by payment*discount2/100
18. set average_price equal total_cost / total_amount
Comments
Leave a comment