0% found this document useful (0 votes)
47 views8 pages

Coding Booklet 3-5

Coading basics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views8 pages

Coding Booklet 3-5

Coading basics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

A glimpse of newly introduced subject according to New Education Policy (NEP) 2020

Basics of
CODING

For Classes 3, 4 & 5

SURVI BOOKS SAPPHIRE (INDIA)


INTERNATIONAL PUBLISHERS PVT. LTD.
Let’s Learn about:
> What is a Computer Program?
> Algorithm

General Introduction of >


>
>
What Does it Take To Be a Programmer?
How a Coder is Different from a Programmer?
What is Scratch?
> What is Python?
> Idle

WHAT IS CODING?
Just a few years ago, computer coding seemed like a mysterious skill that
could only be practised by specialists. To many people, the idea that coding
could be fun was a strange one. But then the world changed. In the space of
a few years, the Internet, email, social networks, smartphones, and apps hit
us like a tornado, transforming the way we live in.
Computers are a huge part of life that we all now take for granted. Instead of
calling someone on the phone, we send a text message or use social media.
From shopping and entertainment to news and games, we guzzle everything
computers have to offer. But we can do more than just use this technology, we
can create it. If we can learn to code, we can make our digital masterpieces.
Everything computers do is controlled by lines of code that someone has
typed out on a keyboard. It might look like a foreign language, but it’s a
language anybody can pick up quite quickly. Many would argue that coding
has become one of the most important skills you can learn in the 21st century.
Computers don’t speak the same language as you and me. They are machines
and the original computers operated with a set of switches that were either on
or off (binary). Coding is a way of bridging the gap between how computers
operate and how humans think. It’s just enough words that they, hopefully,
make sense to us, and that set of instructions, or code, is then compiled into
something the machine can understand.

WHAT IS A COMPUTER PROGRAM?


“Coding”, or “programming”, means writing the instructions step-by-step
that tell the computer what to do. In other words, “A computer program
is a set of instructions that a computer follows to complete a task.”
We are surrounded by computer programs. Many of the devices and gadgets
we use in our daily life are controlled by them. These all machines follow

2
step-by-step instructions written by a computer programmer.
Few of them are listed below:

• Cars: In some cars, computer programs


monitor the speed, temperature, and
amount of fuel in the tank. Computer
programs can even help control the brakes
to keep people safe. Nowadays there is a
lot of research work going on in the field
of driverless cars by tech giants such as
Waymo (by Google) and Tesla. All these
projects are based on programming.

• Mobile Phones: Programs allow you to


make a phone call or send text messages.
When you search for a contact, a program
finds the correct phone number.

• Computer Softwares: Everything


a computer does, from browsing the
Internet to writing documents or
playing music, works because of code
written by a computer programmer.

• Washing Machines: Washing machines


are programmed to follow different cycles.
Computer code controls how hot the water
is and how long the wash takes.

3
• Games: Consoles are just another type
of computer, and all the games that run
on them are programs. All the graphics,
sounds, and controls are written in
computer code.

Hardware and Software:


“Hardware” means the physical parts of the computer that you can see or
touch (all the wires, the circuits, the keyboard, the display screen, and so on).
“Software” means the programs that run on the computer and control how
it works. Software and hardware work together to make computers do useful
things.
Computers might seem very smart, but they are just boxes that follow
instructions very quickly and accurately. As intelligent humans, we can get
them to carry out different tasks by writing programs, or lists of instructions.
Few facts about the computers are given below:
• Computers can’t think: A computer won’t do anything by itself. It’s
up to the computer programmer to give it instructions. Without any
instructions, a computer is clueless.
• Computers need command: You can tell a computer what to do
by writing a set of very detailed instructions called a program. Each
instruction has to be small enough that the computer can understand it.
If the instructions are incorrect, the computer won’t behave the way you
want it to.
• Computers understand programming languages: Computers
can only follow instructions in a language they understand. It’s up to the
programmer to choose which language is best for the task. When we launch
any computer program, they finally converted into “binary code”, a basic
computer language that uses only ones and zeroes. A compiler is used to
process statements written in a particular programming language and turns
them into machine language or “code” that a computer’s processor uses.

ALGORITHM
An algorithm is a set of simple instructions for performing a task. A program
is an algorithm that has been translated into a language that computers can
understand.
4
WHAT DOES IT TAKE TO BE A PROGRAMMER?
A programmer must learn to think like a computer. All tasks must be broken
down into small chunks so that they are easy to follow and impossible to get
wrong. A programmer must have the following qualities:
• having an eye for style and good design
• need to be able to think in a logical, precise and rigorous way
• capable of framing problems the right way
• patience

HOW IS A CODER DIFFERENT FROM A PROGRAMMER?


Coders are the people who write the program behind everything we see and
do on a computer. You can create your programs by learning a programming
language. A coder must be skilled in any of the programming languages.
There is a huge range of programming languages to choose from. Each one
can be used for different tasks. Here are some of the most popular languages
and what they are often used for:
• C: The C programming language is often used for code that runs directly
on a computer’s hardware, such as the Windows operating system. C is
good for building software that needs to run fast and has been used to
program space probes.
• C++: This complicated language is used to build large, commercial
programs such as word processors, web browsers, and operating systems.
C++ is based on C, but with extra features that make it better for big projects.
• JAVA: JAVA code is designed to work on all types of devices, from cell
phones and laptops to game consoles and supercomputers. Minecraft is
written in Java.
• MATLAB: MATLAB is an abbreviation for “matrix laboratory.” While
other programming languages usually work with numbers one at a time,
MATLAB operates on whole matrices and arrays. Language fundamentals
include basic operations, such as creating variables, array indexing,
arithmetic, and data types.
• RUBY: RUBY is a dynamic, open-source programming language with
a focus on simplicity and productivity. It has an elegant syntax that is
natural to read and easy to write. This is the language which automatically
turns lots of information into web pages.

5
• JAVASCRIPT: Programmers use JavaScript to create interactive
features that run on websites, such as advertisements and games.
• ADA: ADA is a state-of-the-art programming language that development
teams worldwide are using for critical software: from microkernels and
small-footprint, real-time embedded systems to large-scale enterprise
applications, and everything in between.
• SCRATCH: Beginners often start with simple programming languages
such as Scratch. Instead of typing out code, you build scripts with ready-
made blocks of code.
• PYTHON: PYTHON is a very popular, all-purpose language. The lines
of code are shorter and simpler than in other languages, making it easier
to learn. Python is a great language to learn after Scratch.

WHAT IS SCRATCH?
The Lifelong Kindergarten group of Media Lab of MIT, which was headed by
Mitchel Resnick, and Playful Invention Company, the consulting company
of Media lab in Montreal, worked together to develop the first desktop-
based version of Scratch. It was released in the year 2003. Scratch is a visual
programming language that makes coding simple. It can be used to make all
sorts of fun and interesting programs. Scratch is a great way to start coding.
Programs are created by connecting blocks of code, instead of typing it out.
Scratch is quick and easy to use, and also teaches you the key ideas you
need to use other programming languages. It is perfect for making games
and animations. It has large collections (or “libraries”) of cool graphics
and sounds that you can play around with. Scratch is designed especially for
age group of 8 to 16 but is used by people of all ages. Millions of people are
creating Scratch projects in a wide variety of settings, including homes, schools,
museums, libraries, and community centres. Scratch is a project of the Lifelong
Kindergarten Group at the MIT Media Lab. It is provided free of charge.

You can directly download scratch from


https://scratch.mit.edu/download.
Programming, or coding, simply means telling a computer what to do. To
write a program you need to think like a computer, which means breaking
down a task into a series of simple steps. Here’s how it works.
Example: Imagine you want a friend to bake a cake, but your friend has
no idea how to cook. You can’t simply instruct “make a cake” because your
6
friend won’t know where to start. Instead, you need to write a recipe, with
simple steps like “break an egg,” “add the sugar,” and so on. Programming a
computer is a bit like writing a recipe.
Now imagine you want to program a computer to create a painting like the
one shown here, with coloured circles overlapping each other at random.
You have to turn the job of painting the picture into a kind of recipe, with
steps the computer can follow. It might look something like this:

Ingredients: Ten circles of various sizes, seven colours


Procedure:
• Clear the screen to create a white background.
• Repeat the following ten times:
a) Pick a random place on the screen.
b) Pick one of the circles randomly.
c) Pick one of the colours randomly.
d) Draw a see-through copy of the circle at that place in that colour.

WHAT IS PYTHON?
Python is a general-purpose interpreted, interactive, object-oriented, and
high-level programming language. It was created by Guido van Rossum
during 1985- 1990. Python is a text-based programming language. It takes
a bit longer to learn than Scratch but can be used to do much more. People
around the world use Python to build games, tools, and websites. It’s a
great language to master because it can help you build all kinds of different
programs. Python looks like a mixture of recognizable words and characters,
so it can be easily read and understood by humans. Python is a versatile
language that can be used to make many different types of programs, from
word processing to web browsers. Python is a general-purpose, versatile
and popular programming language. It’s great as a first language because
7
it is concise and easy to read, and it is also a good language to have in any
programmer’s stack as it can be used for everything from web development
to software development and scientific applications.

You can directly download PYTHON from


https://www.python.org/downloads.

Python is a versatile language that can be used to make many different types
of programs, from word processing to web browsers. Here are a few great
reasons to learn Python.
• Easy to learn and use: Python programs are written in a simple
language. The code is quite easy to read and write, compared to many
other programming languages.
• Contains ready to use codes: Python contains libraries of
preprogrammed code that you can use in your programs. It makes it
easier to write complex programs quickly.
• Useful for big organizations: Python is powerful. It can be used to
write real-world programs. It is used by Google, NASA, and Pixar, among
others.

IDLE
IDLE is Python’s Integrated Development and Learning Environment. IDLE
helps you run and write programs in python. IDLE has the following features:
• Coded in 100% pure Python, using the Tkinter GUI toolkit
• Cross-platform works mostly the same on Windows, Unix, and macOS
• Python shell window (interactive interpreter) with colourizing of code
input, output, and error messages
• Multi-window text editor with multiple undo, Python colourizing, smart
indent, call tips, auto-completion, and other features
• Search within any window, replace within editor windows and search
through multiple files (grep)
• Debugger with persistent breakpoints, stepping, and viewing of global
and local namespaces
• Configuration, browsers, and other dialogues

You might also like