Page 111 - KEC Khaitan C7 Flipbook
P. 111

Code:                                              Flow:





                                                                              ENTER SCORE





                                                                              ASSIGN GRADE

                                                                              IS SCORE >= 85?

                                                                                       NO

                                                                                    IS SCORE >= 75?
                                                                                              NO

                                                                                          IS SCORE >= 65?
                                                              YES
                                                                                                     NO
                                                                         YES
                                                                                                   IS SCORE >= 55?
                                                                                     YES
                                                                                                 YES         NO

                                                            GRADE A     GRADE B    GRADE C     GRADE D     GRADE E




                 Bonus Feature:
                     Validation: Add input validation to ensure the user enters numeric values only.

                     Custom Messages: Include messages for exceptional performance (e.g., “Excellent Work!”
                     for Grade A).
                     Looping Feature: Allow the  program  to  calculate  grades  for multiple  students  without
                     restarting.






























                                                                                        Control Structures in Python  109
   106   107   108   109   110   111   112   113   114   115   116