Page 311 - Artificial Intellegence_v2.0_Class_9
P. 311

Algorithm                                                        Flowchart
                Start
                Input Length, Breadth                                                           START
                Area=Length × Breadth
                Perimeter= 2(Length × Breadth)
                Display "Area is ", Area                                                 Input Length, Breadth
                Display "Perimeter is ", Perimeter
                Stop
                                                                                         Area=Length×Breadth

            Source Code:

            Length= int(input('Enter Length:'))                                       Perimeter=2(Length×Breadth)
            Breadth = int(input('Enter Breadth:'))
            Area= Length*Breadth
                                                                                         Display "Area is", Area
            Perimeter=2*(Length*Breadth)
            print("Area is :", Area)
            print("Perimeter is :", Perimeter)                                            Display "Perimeter is",
            Output:                                                                            Perimeter
            Enter Length : 5

            Enter Breadth : 10                                                                  STOP
            Area is : 50
            Perimeter is : 100



                            Task                                                                Experiential Learning



                 Type "import this" in your Python IDLE and you will find a poem written by Tim Peters, a major contributor
                 to the Python community.
                 _______________________________________________________________________________________________________





                            Task                                                                  Subject Enrichment



                 Input a radius of a circle. Calculate the area and perimeter of circle.
                 _______________________________________________________________________________________________________

                 _______________________________________________________________________________________________________
                 _______________________________________________________________________________________________________

                 _______________________________________________________________________________________________________
                 _______________________________________________________________________________________________________
                 _______________________________________________________________________________________________________



                                                                                   Introduction to Python  309
   306   307   308   309   310   311   312   313   314   315   316