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

                                                                                                    ١٨
   13   14   15   16   17   18   19   20   21   22   23