Page 6 - Touchcode_C8_Flipbook
P. 6

INSIDE  THE  SERIES





                  Learning Resources

                                                INSIDE  THE  SERIES
                    At regular intervals of time, the code automatically changes the traffic signals to show colors
                    (red, yellow, green).  So, you can see how few lines of code running in the background drive   Coding Tip!
                    the traffic light.          Learning Resources
                    What exaCtLy Is CodIng?
                     Coding
                           uiz
                             01 is  a  process  of
                    Coding  or  programming                                            This  section  contains  a hint  for
                    creating  codes  to  instruct  a  computer  to   At regular intervals of time, the code automatically changes the traffic signals to show colors   the student related to a program.
                    perform a specific task. There can be more                             Coding Tip!
                     State whether the following statements are true (T) or false (F). (red, yellow, green).  So, you can see how few lines of code running in the background drive
                    than one way to solve the problem; similarly,   the traffic light.  Coding Quiz
                     a.  A traffic light indicates the road user to act according to the
                                                 What exaCtLy Is CodIng?
                                                  Coding programming
                       displayed sign.
                    there are many ways to write code for the   Coding  or   uiz  01 is  a  process  of   This  section  contains  a hint  for
                                                  State whether the following statements are true (T) or false (F).
                    same task.                   creating  codes  to  instruct  a  computer  to   This  section  contains  a   the student related to a program.
                                                                            Coding Quiz
                                                 perform a specific task. There can be more
                     b.  Traffic lights contain programmed sensors.
                                                  a.  A traffic light indicates the road user to act according to the
                                                   displayed sign.
                                                 there are many ways to write code for the
                             Let see an example:  than one way to solve the problem; similarly,   question from the topic
                                                 same task.                 This section contains a
                                                  b.  Traffic lights contain programmed sensors.
                             When you play video on your smartphone. Your smartphone will act    Coding tip!
                                                       Let see an example:
                                                                            question from the topic
                    Where eLse do We see appLICatIons of CodIng?  taught previously.
                                                       When you play video on your smartphone. Your smartphone will act
                             as a computer which needs to be instructed (in this instructions will   taught previously.
                                                 Where eLse do We see appLICatIons of CodIng?
                                                       as a computer which needs to be instructed (in this instructions will
                                                 These days a lot of our daily lives
                    These days a lot of our daily lives rely on coding. We are somehow connected through  rely on coding. We are somehow connected through   Splash block is used
                             be given by the application which plays the video) at each and every
                                                       be given by the application which plays the video) at each and every
                                                 coding. For example, the smartphones, computers, videogames, car dashboards, etc. are
                    coding. For example, the smartphones, computers, videogames, car dashboards, etc. are
                                                       step on what to be done. The application playing the video provides
                             step on what to be done. The application playing the video provides
                                                       this instruction via programming language.
                    all using some sort of code to perform its task.  all using some sort of code to perform its task.  to display a message
                             this instruction via programming language.  Coding fact
                                                   The first programmer or the first person to write our modern understanding of   on the screen for
                             Coding fact          a program was Ada Lovelace.
                                                                            Coding Fact          some time.
                      The first programmer or the first person to write our modern understanding of
                                                 What Is a programmIng LangUage?
                     a program was Ada Lovelace.   Language is the primary means of communication for all human interactions. In the same   This section contains an   splash ''   ''
                                                               Coding Fact
                                                 way, to interact with computers, you need a language which the computer understands and   interesting fact.
                                                     At a Glance
                                                   Bar code scanner
                                                           Booking tickets
                                                                    Printer
                                                 is called a programming language.
                                                     This section gives a brief summary
                    What Is a programmIng Language?                                    Coding Buzz Words
                                                     of the chapter.
                    Language is the primary means of communication for all human interactions. In the same   This section contains an   This section contains definitions of
                          At a Glance
                    way, to interact with computers, you need a language which the computer understands and   interesting fact.  important words related to coding,
                                    Booking tickets
                      Bar code scanner
                                                   Printer
                                                   at a glance
                    is called a programming language.     A dictionary is a book in which the words and phrases are listed alphabetically,  in alphabetical order.
                                                    Algorithm is a process or set of rules which need to be followed to solve the given problem.
                                                    Software
                          This section gives a brief summary   Thermostat  Video games  Coding Buzz Words
                                                    A flowchart is a tool for representing algorithms and programming logic.
                                                    Pseudocode is used to describe the steps followed in an algorithm via human-comprehensible
                                                 A programming language is a  computer language which is used by programmers  to
                                                   language.
                          of the chapter.        communicate with computers.  It can be defined as a set of instructions written in any
                                                   Touchcode Level 6
                                                  8
                                                    MakeCode  is  a framework used  for creating  interactive and  engaging  programming
                                                 specific computer language to perform a specific task.
                                                   experiences to the world of programming.
                                                                  Introduction to Coding  9  This  section  contains  definitions  of
                                                   exercise                                CodIng BUZZ Words
                                                      Coding Task
                       at a glance               A.  Tick ( ) the correct option.  important words related to coding,
                                                  1.  Which of the following represents a decision symbol?
                                                                                       Array: An Array is a collection of similar data type variables
                       A dictionary is a book in which the words and phrases are listed alphabetically,     This section allow students to   in alphabetical order.
                                                                                       Bug: Any change in the expected and actual output of the program.

                                                              b.

                                                   a.
                                                      familiarise with  the  concept  with
                       Algorithm is a process or set of rules which need to be followed to solve the given problem.     d.        Collection: Container which groups multiple elements into a single object.
                                                   c.

                                                  Video games
                                    Thermostat
                        Software
                                                                                       Compiler:  Programs  which  translate  source code  from  a  high-level  programming
                                                      the help of the task.
                       A flowchart is a tool for representing algorithms and programming logic.  2.  Which of the following is a set of rules or instructions which define a step-by-step process   language to a low level language to create an executable program.
                                                   as how a work is to be executed to get the expected results?    Data type: The type of data which the declared variable can hold.
                                                   a.  Algorithm
                       Pseudocode is used to describe the steps followed in an algorithm via human-comprehensible
                    A programming language is a  computer language which is used by programmers  to        b.  Flowchart     Data validation: Data entered by user is valid value in the place where you are expecting
                                                   c.  Pseudocode
                                                              d.  None of theses
                                                                                      an input from the user.
                      language.
                       Touchcode Level 6
                    communicate with computers.  It can be defined as a set of instructions written in any  Coding task  02    Events: Generalization of all the things on which the program can respond to.
                     8
                                                  3.  Flowchart is used to ........................... .
                       MakeCode  is  a framework used  for creating  interactive and  engaging  programming
                    specific computer language to perform a specific task.  a.  develop understanding of how a process is done.      Event handler: Piece of code which is associated with an event in the code.
                                                         To perform addition operation
                      experiences to the world of programming.   To perform the task, follow these steps:    Function: Block of code which is made up of a set of steps those results in a single
                                                   b.  study a process for improvement.
                                                                                       Introduction to Python
                                                                                      specific action.
                                                   c.  communicate to others, about how a process is done.
                                               Introduction to Coding  9             Step 14:  Drag and drop  the 'splash block to 'on start' block. Your workspace will look like:
                                                  Step 1:     Visit the link: https://arcade.makecode.com/, and creat a new project Addition
                                                                                       High level  programming language: A programmer  friendly language which help
                                                   d.  All of the above
                                                                                        CODING BUZZ WORDS
                                                    Operation.                        programmers to communicate easily to the computer
                                                                                       This section contains supplement topics
                                                  4.  What is the name of this symbol
                      exercise                    Step 2:   The following screen appears:      ?  b.  Process/Processing      Initialization: Assigning a value to variable.
                                                   a.  Terminator
                                                                                       for add-on knowledge.
                            Coding Task
                    A. tick ( ) the correct option.  c.  Document       d.  Decision     Iteration: Doing the same task over and repeatedly, until a certain task is complete, or
                                                                                      a certain condition is met.
                                                                                       Low level programming language: A machine friendly  language  which  is easily
                                                   a.  Algorithm

                                                                                      understood by the computer.
                                                              b.  Flowchart
                     1.  Which of the following represents a decision symbol?  5.  Which of the following refers to a raw program without any syntax?    Array: An Array is a collection of similar data type variables

                                                                                       operator: Symbol which operates on a value assigned to a variable. Example: +,-, *, \
                                                   c.  Pseudocode
                                        b.

                       a.      This section allow students to   d.  Program      Bug: Any change in the expected and actual output of the program.

                                                                                       Redundancy: The same lines of code are not repeated throughout the code and use
                                                                                      functions in places of those lines of code.
                                                                                           IntrodUCtIon to python
                                                                                     Step 15:   Click on the 'on start' to run the program, OR on the 'Play' button present on the left-
                                                  Step 3:   Click on 'Variables', select 'Make a variable', write the name of the variable as 'a',
                                                                                       selection: Situation in which the algorithm needs to make a choice between two or
                       c.      familiarise with  the  concept  with              Collection: Container which groups multiple elements into a single object.

                                        d.

                                                    then click on 'OK'. Variable 'a' will appear in 'Make a Variable…'.
                                                                                        hand side, to see the output.
                                                                                      more alternatives.
                                                   Touchcode Level 6
                                                                                 Compiler:  Programs  which  translate  source code  from  a  high-level  programming
                                                  24
                            the help of the task.
                                                                                       sequencing: An ordered set of instructions or tasks.
                     2.  Which of the following is a set of rules or instructions which define a step-by-step process   language to a low level language to create an executable program.
                                                                                     python
                                                                                       sorting: Rearranging a given array or list elements according to a comparison operator
                                                                                     Python is a popular high-level programming language. It is a powerful language used for
                       as how a work is to be executed to get the expected results?    Data type: The type of data which the declared variable can hold.
                                                                                      on the elements.
                                                                                       Unmodifiable: Collection which do not support modification operations (such as add,
                       a.  Algorithm      b.  Flowchart                              general-purpose programming. Python was developed by Guido van Rossum. He started
                                                                                     applying Python in 1989. Python is extensively used to develop:
                                                                                      remove and clear).
                                                                                 Data validation: Data entered by user is valid value in the place where you are expecting
                                                                                                   websites
                                                                                        games
                       c.  Pseudocode      d.  None of theses                   an input from the user.    web applications
                                                                                        Graphical User Interface programs
                                                                                                      Coding Buzz Words
                                                                                                      Coding Buzz Words
                                                                                                           95
                                                                                                           95
                                  Coding task
                     3.  Flowchart is used to ........................... .  02    Events: Generalization of all the things on which the program can respond to.
                                                                                        Teacher's Corner
                                                                                     InstaLLIng python
                                                                                     Well done, you have created modulus of two numbers program!
                                                  Step 4:   Select the 'Change a by 1'. Block is appear on workspace, click on the value a, and   Follow these steps to download and install the Python software:
                       a.  develop understanding of how a process is done.    change the value of 'a' to 10.    Event handler: Piece of code which is associated with an event in the code.
                                                                                     Step 1:   Open the website http://www.python.org/downloads.
                                to perform addition operation                           It presents questions that promotes
                                                                                                          (HoTs)
                                                                                       higher order thinking skills
                       b.  study a process for improvement.                      Function: Block of code which is made up of a set of steps those results in a single
                                                                                     Step 2:   Click on the Download Python 3.8.3 button.
                                                                                        the experiential learning.
                     to perform the task, follow these steps:                        Write a pseudocode and then draw a flowchart to perform different mathematical operation
                                                                                     Step 3:   Double-click on the downloaded software. You can either look at the bottom of the
                                                                                 More on Python
                       c.  communicate to others, about how a process is done.   specific action.  screen or locate the  software in  the  Downloads  folder  of  your
                                                                                     (Multiplication, subtraction, Addition, Division) on two or more variables.  computer. The
                     Step 1:     Visit the link: https://arcade.makecode.com/, and creat a new project Addition   Step 14:  Drag and drop  the 'splash block to 'on start' block. Your workspace will look like:
                                                                                       Security Warning dialog box appears.
                       d.  All of the above
                                                                                 High level  programming language: A programmer  friendly language which help
                                                                                       teacher’s Corner
                                                                                     Step 4:   Click on Run button. The Python setup window appears.
                        Operation.                                              programmers to communicate easily to the computer
                                                                                     1.  Discuss the concept of variable to the students by using real-life examples.
                                                                                     Step 5:   Select the Add Python 3.8 to PATH checkbox.
                     4.  What is the name of this symbol    ?                    This section contains supplement topics
                                                                                     2.  Ask students to explain the data types and operations that can be performed on the data types.
                     Step 2:   The following screen appears:                     Initialization: Assigning a value to variable.
                                                                                     Step 6:   Click on Install Now button.
                       a.  Terminator       b.  Process/Processing  36  Touchcode Level 6  for add-on knowledge.
                                                                                     After a few seconds, Python will be successfully installed on your computer.
                                                                                       Touchcode Level 6
                                                                                     46
                                                                                     programmIng In python
                       c.  Document       d.  Decision                           Iteration: Doing the same task over and repeatedly, until a certain task is complete, or
                                                                                a certain condition is met.
                                                                                     Python has two basic programming modes—Script Mode and
                                                                                     Interactive Mode.
                     5.  Which of the following refers to a raw program without any syntax?    Low level programming language: A machine friendly  language  which  is easily
                                                                                     Working in Interactive mode
                       a.  Algorithm       b.  Flowchart                        understood by the computer.
                                                                                     Interactive Mode is a command line shell which gives immediate
                                                                                     result  for  each  command. In  Interactive  mode,  we  type  one
                       c.  Pseudocode       d.  Program                          Operator: Symbol which operates on a value assigned to a variable. Example: +,-, *, \
                                                                                     command at a time. Python executes the given command and
                                                                                     gives the output.
                                                                                 Redundancy: The same lines of code are not repeated throughout the code and use
                                                                                            MORE ON PYTHON
                                                                                     Follow these steps to start Python and work in Interactive Mode:
                                                                                functions in places of those lines of code.
                                                                                     Step 1:   Click on start button.
                                                                                                       Opening Python
                     Step 3:   Click on 'Variables', select 'Make a variable', write the name of the variable as 'a',   Step 15:   Click on the 'on start' to run the program, OR on the 'Play' button present on the left-
                                                                                 Selection: Situation in which the algorithm needs to make a choice between two or
                        then click on 'OK'. Variable 'a' will appear in 'Make a Variable…'.  hand side, to see the output.   Introduction to Python  93
                     24  Touchcode Level 6                                      more alternatives.
                                                                                 Sequencing: An ordered set of instructions or tasks.
                                                                               INPUT AND OUTPUT
                                                                                 Sorting: Rearranging a given array or list elements according to a comparison operator
                                                                               Python provides two commonly used functions input() and output() for input and output.
                                                                                on the elements.
                                                                               The input() Function
                                                                                 Unmodifiable: Collection which do not support modification operations (such as add,
                                                                               The input() function takes the user’s input while a program executes. The general syntax of
                                                                                remove and clear).
                                                                               the input() function is as follows:
                                                                               input([<prompt>])
                                                                                                          Coding Buzz Words
                                                                                                          Coding Buzz Words
                                                                               Here, prompt is the string or message we wish to display on the screen. Example:   95 95
                                                                                   Teacher's Corner
                                                                               Well done, you have created modulus of two numbers program!
                                                                               name = input(“Enter your name: “)
                     Step 4:   Select the 'Change a by 1'. Block is appear on workspace, click on the value a, and     >>> Enter your name: “Mohan”
                                                                                  It  presents  questions  that  promotes
                        change the value of 'a' to 10.                         The print() Function
                                                                                                                 (Hots)
                                                                                 higher order thinking skills
                                                                               The print() function prints or sends the output to the standard output device, which is
                                                                                  the experiential learning.
                                                                               usually a monitor. This function auto converts the items to strings, i.e., if you try printing a
                                                                              Write a pseudocode and then draw a flowchart to perform different mathematical operation
                                                                               numeric value, the print() function will automatically convert it into equivalent string and
                                                                              (Multiplication, subtraction, Addition, Division) on two or more variables.
                                                                               print it. The print() function also introduces spaces between items automatically.
                                                                               The general syntax of the print() function is as follows:
                                                                                 teacher’s Corner
                                                                               print [<expression 1> , <expression 2>...]
                                                                              1.  Discuss the concept of variable to the students by using real-life examples.
                                                                               Let’s create a program to use the input( ) and print( ) functions.
                                                                              2.  Ask students to explain the data types and operations that can be performed on the data types.
                     36  Touchcode Level 6                                     46  Touchcode Level 6
                                                                                           Using input() and print() functions
                                                                               VARIABLES IN PYTHON
                                                                               Variables are memory reference points where we store values which can be accessed or
                                                                               changed later. The names given to the variables are known as identifiers. In Python, we
                                                                               do not need to specify the type of variable because Python is a dynamically typed language
                                                                                  Touchcode-VII
                                                                               90 90  Touchcode-VII
   1   2   3   4   5   6   7   8   9   10   11