Page 109 - KEC Khaitan C7 Flipbook
P. 109

PROJECT NAME 5: Greatest Number Checker
                 Software Used: CodeSkulptor

                 Objective:

                 Develop a Python program (WAP) to determine the greatest of three numbers using:
                     Arithmetic operators                              Variables

                     Conditional statements (if, elif, else)           Formatted outputs
                 Use Codeskulptor3-https://py3.codeskulptor.org/


                 Step-by-Step Instructions: (Plan IPO)
                 1.  Input: The user enters three numbers (dynamic - varies with each user).

                 2.  Process: Compare the three numbers using conditional statements (if, elif, else) and determine
                     the greatest number among the three inputs.
                 3.  Output: Display the greatest number in a formatted message. Refer to the sample

                                  The number 200 is the highest among 110,200, and 30 number.


                              Code:                                              Flow:


                                                                             ENTER THREE NUMBERS


                                                                            COMPARE THE NUMBERS
                                                                                    YES

                                                                             IS THE FIRST NUMBER
                                                                                 GREATEST?
                                                                                            NO

                                                                                        IS THE SECOND
                                                                  YES
                                                                                      NUMBER GREATEST?
                                                                                     YES             NO

                                                       DISPLAY FIRST NUMBER   DISPLAY SECOND    DISPLAY THIRD NUMBER
                                                           AS GREATEST      NUMBER AS GREATEST      AS GREATEST


                 Bonus Feature:

                     Logical Operators: Try implementing the same task using logical operators (and, or).
                     Equal Numbers Check: Enhance the program to handle cases where two or all three numbers
                     are equal.

                     Looping Feature: Allow users to  check  multiple  sets  of numbers without  restarting  the
                     program.









                                                                                        Control Structures in Python  107
   104   105   106   107   108   109   110   111   112   113   114