Page 69 - CG_v2.1_flipBooks_class_6
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?
Have you ever wondered how traffic signal’s function? The lights cycle through green, yellow and red
at a regular interval to control the traffic flow at the road intersections. They prevent accidents and
help to avoid congestion on the roads.
However, how do the traffic lights change automatically?
The traffic lights are controlled by the code that runs in background. At regular
intervals, the code changes the traffic signals to show different colours. Sometimes
it is even smarter. When the code detects congestion based on sensors, it maximises
efficiency by only functioning when traffic 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 efficient than others. There may be many ways to solve a problem. Similarly, there could be 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, Confirming the Doctor’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

