Page 69 - Computer Genius Class 06
P. 69

Do you want to know what is code? How it can be applied in our real life, and how it impacts our day-
                 to-day activities? In this chapter we'll learn about these topics.

                 How Do Traffic Lights Work?

                  a e you e er  ondered ho  tra c signal s  unction  The lights cycle through green  yello  and red
                 at a regular inter al to control  the tra c  o  at the road intersections. They pre ent accidents and
                 help to avoid congestion on the roads.
                 However, how do the traffic lights change automatically?


                 The  tra c  lights  are  controlled   y  the  code  that  runs  in   ac ground.   t  regular
                 inter als  the code changes the tra c signals to sho  different colours.  ometimes
                 it is even smarter. When the code detects congestion based on sensors, it maximises
                 e ciency  y only  unctioning  hen tra c is present.
                 Coding in Computer Science


                 Coding, also referred to as programming, is the process of creating step-by-step instructions for
                 computers using programming languages.
                 It is just like solving a maths problem. Just like any other maths problem, some coding approaches are
                 more e cient than others. There may  e many  ays to sol e a pro lem.  imilarly  there could  e more
                 than one way to write a code for the same task and achieve a similar result. For example, suppose, you
                 are playing a video on your smart phone. Your phone is a computer that needs instructions to do anything.
                 The app playing the video provides those instructions. This video-playing app is an example of coding.
                 Where else do we see applications of coding?


                 Most of us knowingly or unknowingly engage with programming, be it inside our homes or outside.
                 Coding, in the modern world, can be found on the streets, in the schools, at the local grocery stores, etc.
                 Some of the practical examples of coding in the real world are:











                  Interaction with bar-code  Scanning QR code to make   Booking tickets for movies,     on irming the  octor s
                 scanners at shopping stores.   payment.        buses, trains, or flights online. appointment in health care sector.





                          Chrome      Safari      Firefox




                           Edge       Opera       Yahoo

                       Computer software we use like web browser,             Making animations, video-games,
                                    MS Word etc.                                        music etc.
                                                                                  Algorithm and Pseudocode    67
   64   65   66   67   68   69   70   71   72   73   74