Page 457 - Computer Science V2.0 Class 11
P. 457

for details in studentDetails.values():
                              if details['percentage'] > subjectToppers['percentage']:
                                  subjectToppers['name'] = details['name']
                                  subjectToppers['percentage'] = details['percentage']

                          return subjectToppers


                      numberOfStudents = int(input("Enter the number of students: "))
                      studentsData = acceptDetails(numberOfStudents)

                      rollToSearch = input("\nEnter Roll Number to search: ")
                      searchedStudent = searchStudent(rollToSearch, studentsData)

                      if searchedStudent:
                          print("\nDetails of the Searched Student:")
                           print(f"Roll  Number: {rollToSearch},  Name: {searchedStudent['name']},  Percentage:
                           {searchedStudent['percentage']}")
                      else:
                          print(f"\nStudent with Roll Number {rollToSearch} not found.")

                      displayAllResults(studentsData)

                      topperDetails = findTopper(studentsData)
                      if topperDetails:
                          print("\nDetails of the Topper:")
                           print(f"Roll Number: {max(studentsData, key=lambda x: studentsData[x]['percentage'])}, Name:
                           {topperDetails['name']}, Percentage: {topperDetails['percentage']}")
                      else:
                          print("\nNo students to display topper details.")

                      subjectTopperDetails = findSubjectToppers(studentsData)
                      if subjectTopperDetails['name'] is not None:
                          print("\nDetails of the Subject Topper:")
                           print(f"Name: {subjectTopperDetails['name']}, Percentage:
                           {subjectTopperDetails['percentage']}")
                      else:
                          print("\nNo students to display subject topper details.")
                                                                CASE STUDY
                    1.  A bank is a financial institution which is involved in borrowing and lending of money. With advancement in technology, online banking,
                      also known as internet banking allows customers of a bank to conduct a range of financial transactions through the bank’s website
                      anytime, anywhere. As part of initial investigation you are suggested to
                         collect a bank’s application form. After careful analysis of the form, identify the information required for opening a savings account.
                         Also enquire about the rate of interest offered for a saving account.
                         The basic two operations performed on an account are Deposit and Withdrawal. Write a menu driven program that accepts either of
                         the two choices of Deposit and Withdrawal, then accepts an amount, performs the transaction and accordingly displays the balance.
                         Remember, every bank has a requirement of minimum balance which needs to be taken care of during withdrawal operations.
                         Enquire about the minimum balance required in your bank.
                         Collect the interest rates for opening a fixed deposit in various slabs in a savings bank account. Remember, rates may be different for
                         senior citizens.
                      Finally, write a menu driven program having the following options (use functions and appropriate data types):
                         Open a savings bank account


                                                                                                        Dictionaries  443
   452   453   454   455   456   457   458   459   460   461   462