Page 137 - Trackpad_V4.0_c7_Flpbook
P. 137

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.




                           SDG Activity


                    Conduct a survey to identify male-to-female ratios among teaching staff, students, and
                    housekeeping staff at your school. Use Python to analyse the data and display the result.
                    Then, suggest three different ways to promote gender equality in your school based on
                    your findings.






                          Explore in the Lab                                        21 st  Century   #Critical Thinking
                                                                                        Skills
                                                                                            #Technology Literacy
                  To
                  Subject  Writing Programs
                   Go to your computer lab & write program to:
                   a.    display a menu with different food items and their prices. Ask the user to select an item from the menu
                       by entering its corresponding number. Using conditional statements, calculate the total bill based on the
                       selected item and quantity.
                   b.    calculate  the  total price  after applying  discounts.  Ask  the  user  to enter the  price  and  the  discount
                       percentage. If the discount percentage is greater than 25%, display a message indicating that the discount
                       is not valid.
                   c.    convert the temperature from Celsius  to Fahrenheit. Take the  temperature as input  from the  user.
                       Determine if the temperature is below freezing (0°C) or not. Display the appropriate message with the
                       converted temperature.
                   d.    calculate the area of a square or circle according to the input given by the user. If the input is 1, then
                       calculate the area of a square, otherwise find the area of a circle. Ask the user to input the values for
                       square or circle based on the input.




                 For The Teacher

                    Discuss all the topics covered in this chapter with the students.
                    Tell the students, how to use indentation to define the body of the conditional statement.









                                                                                Conditional  Statements in Python  135
   132   133   134   135   136   137   138   139   140   141   142