Page 126 - Information_Practice_Fliipbook_Class11
P. 126

09 principal = float(input("Enter Principal Amount: "))
          10 nYears = int(input("Enter time period in Years: "))
          11 if nYears < 3:
          12     rate = 4
          13 elif nYears >= 3 and nYears <5:
          14     rate = 6
          15 else:
          16     rate = 8
          17 simpleInterest = (principal * rate * nYears)/100
          18 print("Principal:", principal)
          19 print("Rate of Interest:", rate)
          20 print("Simple Interest:", simpleInterest)
         nepatlOuSpuS:

         >>> Enter Principal Amount: 4000
         >>> Enter time period in Years: 4
              Principal: 4000.0
              Rate of Interest: 6
              Simple Interest: 960.0
         Program  5.10  WriStl nl progrnel ShnSl coepuSttl Shtl neounSl ofl eonShayl tchoanrthipl Sol btl nwnrdtdl Sol nl tSudtnS,l
         bnttdlonlptrctnSngtlnndlnnnunalfneiaylincoet.


                        Percentage                    Annual Income                   Scholarship

               <40                            NoSlnppaicnbat                 Nia
               >=40lnndl<50                   <65000                         2000lptrleonSh
                                              >=65000                        Nia
               >=50lnndl<75                   <65000                         4000lptrleonSh

                                              >=65000                        3000lptrleonSh
               >=75lnndl<=100                 NoSlSolbtlcontidtrtd           5000lptrleonSh
        Solution:

          01 '''
          02 Objective: To find the amount of scholarship
          03 Inputs:
          04         percentage : percentage of marks
          05         annualIncome : Annual Income
          06 Output: scholarship - monthly scholarship amount
          07 '''
          08 percentage = int(input('Enter your percentage: '))
          09 annualIncome = int(input('Enter the annual income: '))
          10 if percentage < 40:
          11     scholarship = 'Nil'
          12 elif percentage >= 40 and percentage<50:
          13     if annualIncome < 65000:
          14         scholarship = 2000
          15     else:
          16         scholarship = 'Nil'
          17 elif percentage >= 50 and percentage<75:
          18 if annualIncome < 65000:
          19         scholarship = 4000
          20     else:
          21         scholarship = 3000
          22 elif percentage >= 75:
          23     scholarship = 5000
          24 print('Monthly scholarship:', scholarship)

          112  Touchpad Informatics Practices-XI
   121   122   123   124   125   126   127   128   129   130   131