Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 116 - 2625 PortGPt V2.1
P. 116

    4.   Long answer type questions.

                          a.   Write the syntax of the if…else statement.

                               ___________________________________________________________________________

                               ___________________________________________________________________________
                               ___________________________________________________________________________

                               ___________________________________________________________________________

                          b.   What do you understand by the Nested if statements.

                               ___________________________________________________________________________

                               ___________________________________________________________________________

                               ___________________________________________________________________________

                               ___________________________________________________________________________

                      fun Zone

                          Let's soLve
                                                                                                       Critical Thinking
                          1.   Application based questions.
                               a.     Ajit  wants  to  develop a  Python  program  that  check  the  strength  of  the  password

                                    entered by the user based on the following criteria:
                                    •  Weak: Less than 4 characters

                                    •  Moderate: 4-8 characters
                                    •  Strong: More than 8 characters
                                    Which conditional statement should he use?

                               b.     Seema is the owner of a gym. She wants a Python program that calculates the fee on
                                    the basis of the age of the member. Help her by writing the required code. Use the
                                    following criteria:

                                    •  Under 18: 500 per month
                                    •  Above 18 or equal: 700 per month

                               c.     Maria needs to categorise students into different grade levels based on their ages
                                    (e.g., elementary school, middle school, high school). What type of statement should
                                    she use to check the age range and assign the appropriate grade level?

                               d.     Hiral wants to develop a program in Python that checks whether the first letter of the
                                    student’s name is a vowel or consonant. Help her by writing the condition used for this
                                    purpose.
                      114   Premium Edition-VII

| 111 112 113 114 115 116 117 118 119 120 121 |