7STD Chapter 1 Coding Book V1
7STD Chapter 1 Coding Book V1
Learning Objectives:
• Create variables that represent different types of data and manipulate their
values.
• Perform arithmetic operations on their values.
Aarav and Apoorva are two friends studying in Class 7. One morning their class
teacher Ms. Jennifer had an announcement for the class.
Ms. Jennifer: The badge with the message “I met a Goal” is for all the students
who get marks 75 and above in their assignment task.
Ms. Jennifer: And all other students who receive less than 75 marks will receive
the badge with the message “I don’t Give up”.
Aarav to Apoorva: Apoorva! (murmuring)We should perform our best and look
forward to get “I met a Goal” badge.
Apoorva to Aarav: Yes Aarav! We will get one.
The assignment was complete and the marks for each subject was given to the
students. Aarav and Apoorva were thrilled to know the badge they were going to
receive from Ms. Jennifer.
What are we waiting for? Let’s go right away and meet our dear friend DIYA
Robot
At DIYA labs: Apoorva and Aarav visit nearby DIYA Robotics lab and meet
DIYA Robot.
DIYA: Hey Aarav and Apoorva! Good to see you here. And may I know the
reason for your visit.
Apoorva and Apoorva: Yes! DIYA, we have an idea to develop the program. And
we need your help to build it.
Idea
What is a Model?
A model which gives the step-by-step procedures to find a desired output.
Every product is not built in one step. Designing a program also requires a model.
Let us know what are the different sections/steps in a model.
DIYA Robot: Aarav! Let me hear your idea and help you both in building it.
Aarav: We intend to develop a program to add the marks received in all the
subjects and check whether the total obtained is above 75 or not.
DIYA Robot: Good, let us write the program on the platform Microsoft
Makecode Arcade. Microsoft MakeCode is a free online learn-to-code platform
where anyone can build games, code devices, and mod Minecraft!
Plan
Now we know about IDEA, let us know the second part which is PLAN
A new screen pops out.This is called Editor. Refer to the figure on the right side,
an output screen is displayed on the left side of the editor and the middle list
represents the different blocks and the rest of the editor is the coding area.
Similarly, create five more variables and name them as “language 2”, “Maths”, “Science”,
“Social”, “Total”
OUTPUT
Code Decode
language_1 = 60
language2 = 75
Maths = 80 The values are assigned
Science = 68
Social = 88
Total=language_1 +
Total is Found
(language2 + (Maths +
(Science + Social)))
Pint function
game.splash("Total is", Total)
FLOW CHART
START
Set
Set
Set
Set
Set
Calculate
TRUE FALS
Display If E Display
Tot
STOP
KEY CONCEPT
Variables
Variables are used to store data that will be referenced and used throughout the
program. They also enable us to label data with descriptive names, allowing both
the reader and ourselves to better understand our programs. Variable names
should not begin with a number. Here are three steps that you should remember
Data type:
The first American alarm clock was created in 1787 by Levi Hutchins in
Concord, New Hampshire. This device he made only for himself
however, and it only rang at 4 am, in order to wake him for his job.[11]
The French inventor Antoine Redier was the first to patent an adjustable
mechanical alarm clock, in 1847.
ASSIGNMENT TASK
TASK 1: Using the same programming concept find the total marks of 2
students.
TASK 2: Try to build a code to find the average of 2 students with each 4
subjects.
Summary
QUIZ
1. What is the use of the below given block?
Answer:
______________________________________________________
______________________________________________________
a) float
b) int
c) complex
d) bool
5. STOP
The above flow chart represents what ?
a) Data Type
b) Variables
c) If-Else Logic
d) Math Operation
6. Variables are containers for _________ data values.
a) Delete
b) Store
c) Open
d) All the above
7. Match the following:
8. What is the python code equivalent for the below code block?
10. Which line of the code calculates the total and how?
Answer: Line number: _______
Explanation: ________________________________________
_________________________________________________________
REAL-TIME EXAMPLE:
● The concept used in the program is similarly used in schools, colleges and
even in professional organizations to monitor the performance of the
employee/student using their target, marks, grades ect.,
I’m so lost I don’t really get it I’m starting to get it I got this
I could teach it
If you have rated yourself with one of the first three emojis , check with your
mentor for any clarifications and get cleared with the concept.