Page 18 - أساسيات الحاسب الالي2
P. 18
مقدمة فى البرمجة الفصل اﻷول
Tax =10% of purchase amount
If purchaseamount < 150 then
Shipping charge = 10
Else
Shipping charge=15
End-if
Total due = purchase amount +tax + shipping charge
Display customer number, name, purchase amount,Tax, shipping
charge, total due
Display end of program message
End
SHIPPING
CHARGE=15
مثال طور البرنامج السابق ليحسب سعر اﻻصناف النه ائي عل ي اعتب ار الخ صم بن سبة
جني ة وع شرون ف ي المائ ة اذا زاد٢٠٠ في المائة اذا ك ان ال سعر اﻻص لي اق ل م ن١٠
. فان الخصم يساوي خمسة جنيهات١٠٠ جنية واذا قل عن٢٠٠ عن
Display program title
Accept customernomber, name, quantity, price
purchase amount = quantity * price
If purchaseamount <100 then
Discount =5
Else
If purchase amount <200 then
Discount =10% of purchase amount
Else
١٨