Ict Eng t2 From
Ict Eng t2 From
ktabyeg.com
Preparation and Review Committee
Mr. Waseem Salah El-Din El- Mr. Tamer Abdel Mohsen Mansour
Manzlawy Manager of the Educational Computer
Manager of the Educational Computer Department
Department Within the General Administration for
Within the General Administration for Curriculum Monitoring and Evaluation
Curriculum Monitoring and Evaluation
Supervised by
Dr. Akram Hassan
Assistant Minister for Curriculum Development
Supervisor of the Central Curriculum Development Division
1
ktabyeg.com
Contents
S Topics Page
2 Lesson 2: Sensors 17
3 Lesson 3: Robot 27
4 Lesson 4: Scratch 37
ktabyeg.com
3
ktabyeg.com
4
ktabyeg.com
Lesson 1 Artificial Intelligence Applications
Objective :
By the end of the lesson, I will After the lesson, check the correct box:
be able to: I can...
- List types of artificial intelligence
Very good Ok Need more work
- Review some practical
applications of artificial
Very good Ok Need more work
intelligence.
- Suggest the largest number of
ideas for the uses of artificial
Very good Ok Need more work
intelligence in our lives.
Engage:
How has artificial intelligence helped us improve services in life? Explain that.
Learn
In previous years in the primary stage, you studied the definition of artificial
intelligence and some of its uses in our daily lives. In this lesson, we will
discuss the types of artificial intelligence and its applications in our lives.
Types of Artificial Intelligence:
Artificial intelligence is not just one type, but there are many and varied
types. Imagine that we have a large garden full of different flowers, each
flower has a different shape and color, and so is the case with artificial
intelligence.
ktabyeg.com
o Narrow AI:
This type of artificial intelligence focuses on
performing a specific task, such as recognizing
faces or translating languages. Another
example is a robot that can play chess
brilliantly, but it cannot do anything else.
o General artificial intelligence (GAI):
This type of artificial intelligence is more advanced, and can perform any
task that a human can do. Example: A robot that completely mimics a
human, as it can think, innovate, solve complex problems, learn, and
adapt to different situations.
o Super artificial intelligence (SAI):
This type of artificial intelligence is the most advanced; it can solve
problems that are difficult for humans to solve easily, and discover
new things that we have never imagined before.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, search for the uses and the applications of artificial intelligence in
our daily lives?
Applications of artificial intelligence in daily life:
Personal Assistant: Do you have a friend who talks to
you, answers your questions, and performs tasks? This is
the personal assistant like (Siri) or (Alexa), it uses
artificial intelligence to understand your commands and
perform them.
Smart Games: Do you play video games? Some of these
games use artificial intelligence to make the game more
fun and challenging, as the characters in the game can
learn from their mistakes and become smarter.
ktabyeg.com
Smart Cars: Have you ever imagined a car driving itself
without a driver? This is the dream of the future that is
getting closer to being realized thanks to artificial
intelligence.
Digital Doctors: Doctors use artificial intelligence to help
them diagnose and treat diseases faster and more
accurately.
Instant Translator: Have you traveled to another country
and spoken a different language? Artificial intelligence can
translate words and sentences instantly, making it easier
for people to communicate.
Machine
learning
Deep Natural
Learning Language
Processing
Artificial
Intelligence
Fields
Expert Computer
Systems Vision
Robotics
ktabyeg.com
Artificial Intelligence Fields
1. Machine Learning - Learning from Mistakes:
o AI has to learn new things, the more we show it a picture of a cat, the more it
learns to name it, and the more we play a game with it, the smarter it becomes,
this is called Machine Learning, and it is similar to when you learn to ride a
bike, the more you fall, the better you learn how to balance.
ktabyeg.com
Create intelligent models to recognize images, sounds, and movements using
machine learning (Teachable Machine):
Imagine if you could teach a computer to recognize objects in the same way you
learn! This is exactly what Teachable Machine does, an easy-to-use tool that helps
you create intelligent models to recognize images, sounds, and movements.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, download the Teachable Machine website.
Note: It is preferable to update your internet browser and work on the Microsoft
Edge browser.
ktabyeg.com
After the young child sees a lot of pictures and hears names, his little brain
starts to understand the difference between a cat and a dog, just like when
scientists try to train a computer to understand pictures and sounds.
The child has learned so well that he can now tell the difference between a cat
and a dog on his own, and in the same way, the computer has learned to
recognize different things, and we can use it for a lot of fun things!
Imagine that we want to teach the computer to recognize numbers. We can start by
giving him pictures of numbers from “0-9,” and telling him what number is in each
picture. After a while, the computer will be able to look at any number and tell us
what it is.
10
ktabyeg.com
1. Classification that includes a group of images that belong to a specific category
such as images of numbers "from 0-9" and another classification that includes
images of alphabet letters.
2. Upload images of numbers in (Class1).
11
ktabyeg.com
3. Open the camera, prepare images of numbers on paper boards" and have the
model take them in (Class2),
Note: The images were provided to the model in the form of files or he takes
them through the Web camera.
4. The artificial intelligence model is trained on the image categories that were
given to it.
5. Add more image categories when needed, for example "adding special symbols".
6. After that, the model can be given an image that determines for us which
category of images it follows.
Save the project:
1- Save the project on Google Drive…
2- Download the project to the device..
Practical example:
Suppose you want to make a game where you control a character on the screen
with your hand movement, here are the steps:
Training: You record your hand in different positions (such as raising the hand,
lowering it, moving it right and left).
Recognition: Teachable Machine learns to associate each position of your hand
with a specific movement of the character on the screen.
Game: When you move your hand in front of the camera, the character on the
screen moves according to what the computer has learned.
12
ktabyeg.com
Example application:
Access the site:
Open your browser and type "Teachable Machine" in the search bar, then access
the site.
Select the training model:
We find several options, choose the option related to image recognition (Image).
Prepare the camera:
The site will ask you to choose to upload images (upLoad) or allow it to use your
device's camera (web). Click on the camera (web) and make sure that the lighting
is good and the camera background is simple so that the computer focuses on the
movement of your hand.
Train the computer.
Create Classes:
Create at least two classes (Class1) and (Class2), for example (Class1) "Raised
hand" and (Class2) "Shaky hand".
Record examples: In front of each category, record several examples of the
corresponding hand movement, for example, in front of the category "raised
hand", raise your hand several times and each time raise it with a specific
movement or a different shape, and so on in front of the category "shaky
hand".
Review examples: Make sure that the examples are clear and that the
computer understands the difference between the two movements.
Training: After you finish taking the pictures, click on the "Train Model"
button to teach the computer these movements.
Test the model: After you finish training, the site will ask you to test the
model.
o Camera: Point the camera at your hand and perform the movements you
trained.
o Results: You will see that the computer will try to guess the movement you
are performing.
Save the model: If you like the model, you can save it and use it in other
projects.
13
ktabyeg.com
Ideas for your projects:
Recognize faces: Train the computer to recognize the faces of your friends
and family.
Create a motion control game: Use your body movements to control
characters in a video game.
Image classification: Teach the computer to classify images into different
categories (such as animals, food, colors).
Create a robot that follows you: Build a small robot that follows you
wherever you go.
14
ktabyeg.com
Learn by doing
Put a check mark () in front of the correct sentence and a check mark () in
front of the incorrect sentence.
1. Artificial intelligence is only used in the video game industry. ( )
2. Artificial intelligence can help doctors diagnose diseases. ( )
3. Self-driving cars depend entirely on artificial intelligence. ( )
4. Artificial intelligence can learn new things slowly. ( )
5. Artificial intelligence is a science of computer science. ( )
6. For artificial intelligence to become intelligent, it needs small amounts of
information. ( )
7. Artificial intelligence is only one type. ( )
8. Narrow artificial intelligence can perform any task that a human can
perform. ( )
9. General artificial intelligence is more advanced. ( )
10.General artificial intelligence focuses on performing a specific task. ( )
11.Super artificial intelligence can solve specific problems. ( )
12.Smart Games are used to make playing games more fun. ( )
13.Instant Translator is used to facilitate communication between people. ( )
14.Smart Shopping gives you suggestions for products you might like. ( )
15.Natural language processing is like a machine language translator. ( )
16.Robots are very good at doing a lot of things with great accuracy. ( )
Self-assess
Go to the objectives at the beginning of the lesson.
Check the correct, I can........ box.
15
ktabyeg.com
16
ktabyeg.com
Lesson 2 Sensors
Objective:
By the end of the lesson, I will After the lesson, check the correct box:
be able to: I can...
- Mention the different types of Very good Ok Need more work
sensors and their areas of use.
- List the importance of sensors in
our modern life. Very good Ok Need more work
- Design a simple project based on Very good Ok Need more work
the idea of sensors.
Engage:
How do sensors work? What devices have you seen or
used in your life?
Learn
In this lesson, we will learn about one of the most important concepts in the
world of modern technology, which is sensors. These simple devices play a
major role in our daily lives, from their use in robots to their use in our
smartphones, modern cars, and alarms.
We will learn together how these devices work and what their types are, and
we will review real-life examples that help us understand how they work and
how they are used in electronic devices and robots.
17
ktabyeg.com
How do sensors work?
Have you ever wondered how the sensation of light, heat, or sound is converted
into numbers in a computer? Imagine that the sensor is a translator that translates
those sensations (such as heat, light, or sound) into a language that the computer
understands, which is the language of numbers. Sensors work through 3 main
steps:
1. Sensing: Captures information from the surrounding environment (such as heat,
light, or sound).
2. Signal Conversion: Converts this information into electrical signals that can be
read by electronic devices.
3. Transmission: Signals are sent to another device to display the results or
perform a specific operation. For example, a thermometer displays the temperature
result on a digital screen.
18
ktabyeg.com
Motion Sensors: These detect movement and changes in direction. These
sensors help the robot navigate and interact with surrounding objects.
Special Sensors: Such as temperature and humidity sensors.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, mention examples of electronic devices that use sensors?
Some examples of electronic devices that use sensors:
Vacuum cleaner robot: uses sensors to avoid obstacles and clean under
furniture.
Surgical robot: uses precise sensors to perform surgeries.
Self-driving cars: rely heavily on sensors to see the road and make
decisions.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, discuss with your colleagues the types of distance sensors?
Types of distance sensors and examples of them:
The types of distance sensors used in robots and smart devices vary, and each type
has its own advantages and uses. Here is a detailed explanation of the types of
these devices with illustrative examples:
1- Ultrasonic Sensors:
Working principle: These devices emit high-
frequency sound waves, then receive the returning
waves after they bounce off an object, and by
measuring the time it takes for the wave to return,
the distance to the object can be calculated.
Examples:
o Vacuum cleaner robots: These devices are used to locate furniture and
obstacles to avoid colliding with them.
o Parking systems: They help measure the distance between the car and
surrounding obstacles.
19
ktabyeg.com
o Fluid levels: They are used to measure the level of fluids in tanks and
reactors.
2- Laser Rangefinders:
Working principle: These devices emit a laser
beam and then measure the time it takes for the
beam to return after bouncing off the object,
and are characterized by high accuracy and a
longer range compared to ultrasonic devices.
Examples:
o 3D laser scanners: They are used to create
3D models of spaces.
o Ground scanning systems: They are used in geological and
archaeological surveys.
o Industrial measurement systems: They are used to measure dimensions
with high accuracy in various industries.
20
ktabyeg.com
Examples:
o Remote controls: Infrared rays are used to communicate with electronic
devices.
o Non-contact thermometers: Used to measure body temperature without
the need for direct contact.
5- Time of Flight sensors:
Working principle: It depends on measuring the
time it takes for a light pulse to reach an object
and return to it, characterized by high accuracy
and high speed.
Examples:
o 3D sensors: Used to create 3D models of
objects.
o Motion tracking systems: Used in video games and virtual reality
systems.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, discuss the factors for choosing the appropriate type of sensor?
Choosing the appropriate type of sensor depends on several factors, including:
Required range: The maximum distance that the device must measure.
Required accuracy: The required measurement accuracy.
Operating environment: The environmental conditions in which the device
will operate (lighting, temperature, humidity).
Cost: The cost of the device and installation.
By choosing the appropriate device, robots and smart devices can interact
with their environment more accurately and effectively.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, mention electronic devices that you use in your daily life and that
depend on sensors in their work?
21
ktabyeg.com
Daily applications of sensors:
Sensors are used daily in our lives, and the most prominent of these applications
are:
In smartphones: There are sensors that help in taking pictures, adjusting the
lighting level, and even determining the location of the phone.
In modern cars: Sensors are used to determine speed, warn of collisions,
and help the driver park his car.
In smart homes: Motion sensors turn on the lights automatically when
someone enters the room.
Phone microphone: It is a sound sensor that converts the sound you pick up
into electrical signals that can be understood by the phone.
Motion sensor in games: When you tilt your phone to the right or left while
playing a game, the motion sensor is what tells the game to change the
direction of the character.
Touch screen: It is a group of small sensors that sense where your finger
touches the screen.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues - and with the help of the science teacher, use a temperature sensor.
Practical activity:
Required materials:
Temperature sensor.
A cup of hot water.
A cup of cold water.
Steps:
1. Measure the temperature of the hot water using the temperature sensor.
2. Repeat the process with cold water.
3. Notice the difference in temperatures displayed on the device screen.
22
ktabyeg.com
Learn by doing
23
ktabyeg.com
6. Laser rangefinders are accurate because they use ……......
A. Sound waves
B. Visible light
C. High frequency waves
D. Laser beams
7. A common application of sensors is the use of infrared in .............
A. Smartphones
B. Remote controls
C. Vacuum cleaners
D. 3D scanning
8. In which environment are light sensors useful? ………....
A. In dark rooms
B. In places with variable lighting conditions
C. In underwater environments
D. In noisy factories
9. One of the sensors that are used to measure distance using high frequency
sound waves is ………......
A. Ultrasonic sensors
B. Laser rangefinders
C. Infrared sensors
D. Motion sensors
10. ……....... sensors are used to turn on lights when someone enters the room.
A. Smartphone
B. Smart car
C. Smart Home Lighting System
D. Smart Watch
24
ktabyeg.com
11. …………. is used for non-contact temperature measurement.
A. Ultrasonic sensor
B. Infrared sensor
C. Light sensor
D. Motion sensor
12. ……….. is the main purpose of the signal conversion step in sensors.
A. Display the results
B. Send the signals to another device
C. Convert the information into electrical signals
D. Turn off the sensor
13. …………… helps cars determine the distance to other vehicles.
A. Sound sensors
B. Light sensors
C. Infrared sensors
D. Distance sensors
14. …………… is the practical use of motion sensors in games.
A. Change the volume
B. Adjust the brightness of the screen
C. Track the movements of players
D. Improve the sound quality
15. Factors that determine the choice of a sensor for a particular
application……….. .
A. Brand of the device
B. Color of the device
C. Environment and required accuracy
D. Size of the device
25
ktabyeg.com
26
ktabyeg.com
Lesson 3 Robots
Objectives:
By the end of the lesson, I will After the lesson, check the correct box:
be able to: I can...
- Explain the concept of robot. Very good Ok Need more work
- List the types of robots and their Very good Ok Need more work
functions.
- Suggest the largest number of Very good Ok Need more work
ideas for the uses of robots in our
lives.
Engage:
What is a robot? What functions can a robot perform? Explain?
Learn
The world is full of amazing robots that can do incredible things! Can you imagine
a robot that can clean your room, another that can help you with your daily tasks?
Or maybe a small robot that runs and plays with you like a pet! Robots can help us
in our daily lives and in various fields.
Definition of Robot:
A robot is a device that can be programmed to perform a set of specific tasks
automatically. The robot can move, sense (via sensors), and interact with its
surroundings and can be used in environments that require precision and speed of
performance.
Example: When we see a vacuum cleaner moving by itself in the house to clean
the floor, this is a type of robot that works independently.
1- Types of robots: There are several types of robots, including:
27
ktabyeg.com
Industrial robots:
They are robots used in factories, and they can perform work with high
accuracy, such as robots that work in car production plants on production
lines quickly and accurately.
Home robots:
These robots are found in homes, cleaning
robots such as Roomba that help clean floors
without any human effort, such as smart
vacuums.
Medical robots:
Medical robots help doctors perform surgeries,
and they can be very accurate.
Educational robots:
These robots are used in schools to teach students how to program and
technology, such as LEGO Mindstorms robots that can be programmed to
perform specific tasks, to help students and to be an aid to the teacher.
Types of Robots
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, discuss with your colleagues the components of the robot.
28
ktabyeg.com
2- Robot components:
Structure
The structure is the main part that
carries all the components of the
robot. It can be made of different
materials such as metal, plastic, or
carbon. The design of the structure affects the weight of the robot and its
ability to move.
Sensors
Sensors are the senses of a robot.
Just as we use our eyes to see and
our ears to hear, a robot uses sensors
to pick up information from its
surroundings. Some examples of
sensors are:
o Sound sensors: pick up and
analyze sounds.
o Cameras: help robots “see”
things in front of them.
Motors
Motors are used to move parts
of a robot. There are different
types of motors, such as
electric motors and pneumatic
motors, each with its own
uses. Motors are the industrial
muscles of robots. Thanks to
motors (actuators), robots can
move and execute commands.
o Motors: make robots
move.
o Robotic arm: used in factories to move objects with precision.
29
ktabyeg.com
Controller:
The controller is the “brain” of
the robot, processing the data
collected by the sensors and
issuing commands to the motors.
The controller can be as simple
as electronic circuits or as
complex as microcomputers. Just as our brain thinks when we decide to
move, the processor makes the decisions necessary to move the robot.
Power Source:
Robots need a power source to
operate. Power sources can be
batteries, solar cells, or even
direct electrical power sources.
The choice of power source
depends on the type of robot and
the required operating time.
Software:
Software is what makes a robot
“smart.” Software includes
algorithms that determine how
the robot responds to information
it receives from sensors.
Software can range from simple
programs to complex artificial
intelligence systems.
Communication tools:
Robots use communication tools
to interact with users or other
robots. These tools can include
Bluetooth, Wi-Fi, or other
communication technologies.
30
ktabyeg.com
Example: A home robot, such as a robot vacuum cleaner, has sensors to avoid
collisions with furniture and room walls.
3- Areas of use of robots:
Robots have become part of our daily lives and are used in several fields, such as
medicine, industry, and education.
For example, in hospitals, there are robots that perform precise surgeries, while in
factories, they help manufacture cars. Robots have many applications in
different fields, including:
Industry: Improving productivity and reducing human errors.
Healthcare: Assisting doctors in surgeries or providing care for patients.
Education: Providing interactive educational experiences for students.
Agriculture: Using robots in precision agriculture to increase crops and
reduce waste.
Activity:
Dear student, with the help of your teacher and in cooperation with your
colleagues, discuss what are the challenges facing robotics technology?
31
ktabyeg.com
4- Challenges
Despite the many benefits of robotics, there are challenges facing this technology,
such as:
Safety: The need to ensure the safety of robots during work.
Employment: Concern that robots may replace human labor.
Ethics: Issues related to robots and their impact on society.
Activity: Dear student, with the help of your teacher and in cooperation
with your colleagues, discuss what are the benefits of robots?
5- Benefits of robots:
Robots offer many benefits in various fields, as they help improve work efficiency,
reduce errors, and save time. The most prominent benefits of robots are:
- Increased efficiency and productivity
Industrial robots can work continuously without fatigue or interruption,
which increases the amount of production in factories and saves time.
In production lines, robots can perform repetitive tasks accurately and
without any delay, which improves the quality of products and reduces
errors.
- High accuracy and reduced errors
Medical robots are used in complex surgeries, helping doctors achieve
greater accuracy and reduce the chances of human error.
In the electronics industry, robots assemble small parts with precision,
improving manufacturing accuracy and reducing losses due to defects.
- Safety and security
Robots help in dangerous tasks, such as dismantling bombs or working in
hazardous environments, which reduces the risk to human lives and makes
these tasks safer.
In factories, robots can handle heavy weights and hazardous chemicals,
reducing the chances of worker injury.
32
ktabyeg.com
- Adaptability to diverse work
Robots can be programmed to perform various tasks as needed, making
them capable of performing different jobs efficiently. For example, home
robots can clean or entertain.
In the field of education, robots help students learn programming and
science in interactive ways to help students and teachers.
- Reduce costs in the long run
Although the cost of manufacturing and installing robots may be high,
robots reduce costs in the long run by reducing the need for human labor,
achieving greater accuracy, and reducing errors and waste.
- Contributing to development
Robots encourage technological development and open new horizons in
many fields such as space, where robots are used to explore planets.
In the field of medicine, robots contribute to advanced medical research and
the development of new treatments.
Activities:
Dear student, with the help of your teacher and in cooperation with your
colleagues, you can do some of the following activities:
Through the Internet, search for a picture of a robotic vacuum cleaner,
discuss with your colleagues how it works using sensors
Search for pictures of types of robots, try with your colleagues to classify
them according to use (domestic, industrial, medical, exploratory).
Think of a robot that helps you and your colleagues in your daily lives,
describe how this robot can work.
Draw a robot on a piece of paper for you to use at home, identifying the
three parts: motors, sensors, and processor.
Draw an idea for a robot that you wish to own or manufacture in the future,
and write a short description of its function.
33
ktabyeg.com
Learn by doing
First: Put a check mark () in front of the correct sentence and a check mark
() in front of the incorrect sentence.
1. Sensors do not play a role in the movement of robots and sensing their
surrounding environment. ( )
2. Robots work is limited to factories only. ( )
3. Medical robots help doctors perform surgeries. ( )
4. The design of the structure affects the weight of the robot and its
ability to move. ( )
5. Vision sensors are used to capture sounds. ( )
6. The motors used in robots include electric motors and air motors. ( )
7. The control unit processes the data collected by the sensors and issues
commands to the motors. ( )
8. Robots rely on direct energy sources only and we cannot use batteries
or solar cells. ( )
9. Robots do not need to use software in their work. ( )
10.Robots use communication tools to interact with users or other robots. ( )
11.The areas of use of robots include industry, healthcare, and education. ( )
Second: Choose the correct answer from the following:
1- The challenges facing robotics technology include………...
A- Increased reliance on paper documents.
B- Increased reliance on smartphones.
C- Safety, employment and ethics.
D- Increased reliance on traditional machines.
2- In production lines, robots can perform repetitive tasks accurately and
without any delay, which leads to..................
A- Increased efficiency and productivity.
B- Decreased efficiency and productivity.
C- Lack of product development.
D- Slow production process.
34
ktabyeg.com
3- Robots help in dangerous tasks such as.................
A- Transportation.
B- Handling heavy weights and hazardous chemicals.
C- Irrigating gardens and parks.
D- Cleaning the house
4- To take pictures and videos, we use sensors …………...
A- Sound
B- Touch
C- Light
D- Vision
Self-assess
Go to the objectives at the beginning of the lesson.
Check the correct, I can........ box.
35
ktabyeg.com
36
ktabyeg.com
Lesson 4 Scratch
Objective:
By the end of the lesson, I will After the lesson, check the correct box:
be able to: I can...
- Explain the uses of the Scratch Very good Ok Need more work
program
Engage:
What is Scratch? Suggest some simple projects where Scratch can be used.
Learn
Scratch Program:
Scratch program provides a very wide range of ideas that can be programmed,
including games, animations, comics, music, simulations, and interactive games
for artificial intelligence for the student to learn the principles of programming.
Scratch program allows students to be creative while learning, to feel as if they are
playing a fun game while learning, as it is a fun and easy-to-use educational tool
that allows learning the basics of programming in a visual and enjoyable way
without the need to write a lot of complex codes.
ktabyeg.com
Free program: Scratch can be downloaded from its official website and used
for free.
Developing creative thinking: Scratch helps learners develop their skills in
creative thinking and problem-solving.
Enhancing problem-solving skills: By trying mistakes and learning from
them, students learn how to solve problems in a logical way.
Developing Collaboration Skills: Students can work together on Scratch
projects, which enhances teamwork skills.
An exciting start to the world of programming: Scratch provides a strong
foundation for moving on to more difficult programming languages in the
future.
Sharing the project: Projects can be shared with others.
Activity: With the help of your teacher and in cooperation with your
classmates, discuss with them how you can start using Scratch to create your
first project?
Getting Started with Scratch:
1. Download: Scratch can be downloaded for free from its official website, it
can be obtained from the Internet through the link https://scratch.mit.edu.
2. Explore: Explore the interface and learn how the different blocks and
commands work.
3. Create a project: Start by creating a simple project, such as animating a
character or creating a short story.
4. Save the project.
38
ktabyeg.com
Getting to know the program interface:
1. Menu Bar.
2. Command Blocks Area.
3. Script Area (it collects programming sections "composing a group of
graphical commands called blocks in a specific order").
4. Stage Area (it shows the result of the work or project).
5. Sprite object.
6. Sprites Area (it contains the objects used in the project).
Activity:
With the help of your teacher and in cooperation with your colleagues, discuss
with them how you can change the language of the program interface?
ktabyeg.com
Try to change the language of the Scratch program interface to Arabic.
40
ktabyeg.com
- To make the object's movement steps 30 steps, double-click on the value 10
on the (command) block and write the value 30 as in the following figure:
Write the value 30 on the block as in the following figure:
41
ktabyeg.com
3-Then click and drag on the command and drop it into the platform below the
previous command.
ktabyeg.com
5-To stop the execution of the project, click on the icon
Note: When executing the previous project, we notice that the movement was
done quickly. To address this, we can use the Wait command from Control
Blocks by following the following:
1- Click on Control Blocks
2- Click and drag a command and drop it into the Script Area
3- Place it as shown below:
43
ktabyeg.com
Important notes:
The wait value represents (1 second).
Installing a set of commands in a specific order called a code section.
Use click, drag and drop to deal with any command (within) the code
section.
Modify the project (1): Modify the previous project to make the movement
continuous
To make the movement continuous, you can install the command several
times
Re-arrange it by clicking and dragging to the place where you want to
start the repetition
Modify the word "Hello" to the phrase "Good morning".
Activity:
With the help of your teacher and in cooperation with your colleagues, discuss
with them how you can:
- Determine the value of the object's coordinates on the platform?
- Change the value of the object's coordinates on the platform?
44
ktabyeg.com
Note that:
Before implementing the project, the value of the object's coordinates on the
platform is:
X=0 which is the horizontal axis and represents horizontal movement, Y=0
which is the vertical axis and represents vertical movement
Implement the project Note the value X=0 and the value Y=0 after
implementing the project
You can control the position of the Sprite on the platform by clicking on it
and (drag & drop).
Activity:
With the help of your teacher and in cooperation with your colleagues,
discover with them the coordinates of the platform, how can you change the
position of the object on the platform?
45
ktabyeg.com
Discover the coordinates of the platform
You can control the location of the Sprite object on the platform by clicking
on it and (drag & drop) to another place on the platform.
46
ktabyeg.com
Note that:
- The file name is "Sb3 Project 1"
- The file extension is Sb3.
47
ktabyeg.com
Learn by doing
Put a check mark () in front of the correct sentence and a check mark () in
front of the incorrect sentence.
1- The Scratch program provides a very wide range of ideas that can be
programmed. ( )
2- The Scratch program helps the student learn the principles of programming.( )
3- The Scratch program is considered a difficult educational tool to use. ( )
4- The student in the Scratch program needs to write a lot of complex codes. ( )
5- Scratch uses a visual interface based on blocks. ( )
6- The Scratch program is paid. ( )
7- In the Scratch program, students face difficulty in sharing projects
with others. ( )
8- In the Scratch program, the Stage area shows the programming sections. ( )
9- In the Scratch program, the result of the work or project appears in the Area
Blocks area. ( )
10- To implement the project, click on the symbol. ( )
Self-assess
Go to the objectives at the beginning of the lesson.
Check the correct, I can........ box.
48
ktabyeg.com
49
ktabyeg.com
Lesson 5 Sprites Area in Scratch
Objectives:
By the end of the lesson, I will After the lesson, check the correct box:
be able to: I can...
Engage:
How can you set up a simple project on Scratch?
Learn
Sprites area (contains the sprites used in the project), sprites used in the
project appear as follows:
50
ktabyeg.com
1- The name of the sprite (you can
modify it by clicking on it and
renaming it).
2- The location of the sprite and
determines it (the horizontal axis
is the X values and the vertical
axis is the Y values, note the
current location of the sprite (cat)
on the platform is ((60,0)
3- The direction of the sprite’s
movement: (You can change the
direction by changing the
Direction value).
4- Show or hide the sprite on the
platform.
5- The size of the sprite and its value
can be changed.
6- Delete the sprite from the
platform.
7- Add a new sprite Choose Sprite.
Activity:
With the help of your teacher, make the following changes to the Sprite:
1- The name of the sprite (you can modify it).
2- The location of the sprite on the platform is (100,80(
3- The direction of the sprite’s movement.
4- Show or hide the sprite from the platform.
5- The size of the sprite to the value 50.
6- Delete the sprite from the platform.
7- Add a new sprite.
51
ktabyeg.com
Add a new sprite:
To add a new sprite in the
sprites area
-Click on Choose Sprite
Select Basketball
-Remove the cat sprite from the
stage
52
ktabyeg.com
Project 2:
Required to move the ball randomly on the platform while making a sound
for the ball and repeating this 10 times
Project creation steps:
1-From Motion
2-Choose the Go to random position command
3-From Sound
4-Choose the command Play sound
53
ktabyeg.com
5-To repeat the movement 10 times from Control
6-Choose the Repeat command.
To execute the
project
7-From Events
8-Choose the
When Clicked
command
Test the
execution of
the project
54
ktabyeg.com
Project (3) Spaceship
-Insert a new sprite Rocketship
55
ktabyeg.com
-Remove the cat sprite from the stage.
56
ktabyeg.com
-Insert a new background by clicking on Choose a Backdrop, browse through
the different backgrounds and then choose “Space”.
57
ktabyeg.com
Activity:
With the help of your teacher and in cooperation with your colleagues, do the
following:
Make the spaceship move randomly, make a sound for the spaceship, change
the size of the spaceship, repeat this 5 times, make the spaceship’s location on
the platform start from (0, 0)
58
ktabyeg.com
Implement Project 3
Activities and Projects:
With the help of your teacher and in cooperation with your classmates, do the
following:
Square Drawing Project:
1. Open a new project: Open Scratch and start a new project.
2. Select the pen: We will use the "pen" to draw our picture. In the code area,
find the "pen" section and drag the "pen" block down. This block will make the
pen start drawing.
Note: Click on Add Extension and the pen
ktabyeg.com
Learn by doing
Put a check mark () in front of the correct sentence and a check mark () in
front of the incorrect sentence.
1. The sprites used in the project appear in the Sprites area. ( )
2. The sprite name can be modified only once. ( )
3. The location of the sprite on the platform is determined by the value
of the horizontal axis X only. ( )
4. The horizontal and vertical axis are used to know the current location
of the sprite on the platform. ( )
5. To modify the name of the sprite, click on its current name and
rename it. ( )
6. The direction of the sprite’s movement can be changed by clicking
on the word Direction. ( )
7. The sprite can be shown or hidden on the platform by clicking on
Choose Sprite. ( )
8. The size of the sprite is changed by its value in the Sprites area. ( )
9. The sprite can be deleted from the platform. ( )
10.Only one sprite can be added to the platform. ( )
11.To add a new sprite, click on Choose Sprite. ( )
12.The Stop command is used to watch the project execution. ( )
13.A new background is inserted for the project through the
programming area. ( )
14.The Start command is used to stop the project. ( )
15.We use the coordinates (x, y) to locate the point on the stage. ( )
Self-assess
Go to the objectives at the beginning of the lesson.
Check the correct, I can........ box.
60
ktabyeg.com
61
ktabyeg.com
Lesson 6 Principles of Python
Objectives:
By the end of the lesson, I will After the lesson, check the correct box:
be able to: I can...
- List the uses of the Python Very good Ok Need more work
language
Engage:
What is Python programming language? How can the application be
downloaded from the official website?
Learn
What is Python:
Before we start defining Python, we must know that the first version of the
language was in 1991. It is a programming language widely used in data science
and machine learning, and for developing websites and applications.
Features of Python:
1. Open source: Python is free and open source, allowing everyone to use and
develop it.
2. Interpreted language: Which means that it translates programming codes line
by line, so if there are errors in the program code, it will stop working, as
programmers can quickly find errors in the codes.
3. Versatility: It can be used in developing web applications, data science,
artificial intelligence, machine learning, and game programming.
62
ktabyeg.com
4. Easy-to-use language: It is one of the easiest programming languages for
beginners because of its simple and organized formula and uses words similar
to English, unlike other programming languages.
5. Integration: Python can be integrated with other languages such as C, C++,
and Java, and it can also be used in developing multi-platform programs.
6. Libraries: Python has many libraries that you can use.
Python Libraries
They are pre-built codes and functions that help programmers perform specific
tasks without having to write codes from scratch, libraries are a powerful tool
that increases the efficiency and effectiveness of programming using Python, as
they provide ready-made solutions to many common problems or requirements.
like:
NumPy: is a library widely used in data science, statistics, and artificial
intelligence.
Pandas: is a library for analyzing and processing data.
Matplotlib: is a library for creating graphs and charts
63
ktabyeg.com
How to download the program from the official website:
1- Visit the official Python website www.python.org
2- Choose “Download”
64
ktabyeg.com
3- Then choose the system you are working on (Windows, Mac, or Linux).
65
ktabyeg.com
5- After downloading, install the program on your device and follow the
instructions.
Self-assess
Go to the objectives at the beginning of the lesson.
Check the correct, I can........ box.
66
ktabyeg.com
Learn by doing
Put a check mark () in front of the correct sentence and a check mark () in
front of the incorrect sentence.
1. Python is a free and open-source language, which does not allow anyone
to develop it. ( )
2. It is not permissible to create applications and websites in Python. ( )
3. Python uses data science and machine learning. ( )
4. Python is an interpreted language because it translates programming
codes line by line. ( )
5. Python is used in developing web applications, data science, artificial
intelligence, machine learning, and game programming. ( )
6. Python is one of the most difficult programming languages. ( )
7. Python can be integrated with other languages such as C, C++, and Java. ( )
8. One of the disadvantages of Python is the lack of libraries that you
can use. ( )
9. NumPy: A library used in data science, statistics, and artificial
intelligence. ( )
10.Pandas: A library for analyzing and processing data. ( )
- Download Python from the official website and arrange the following steps
in the correct order.
1- You must choose 64bit or 32bit, depending on your device specifications.
2- Visit the official Python website www.python.org
3- Choose the system you are working on (Windows, Mac, or Linux).
4- After downloading, install the program on your device and follow the
instructions.
5- Choose "Downloads"
67
ktabyeg.com
68
ktabyeg.com
Lesson7 Variables in Python
Objectives:
By the end of the lesson, I will After the lesson, check the correct box:
be able to: I can...
Engage:
What are variables in programming languages? How can they be written and
classified?
Learn
Variables in programming languages express a reserved place in memory to store
and save a specific value, where the value can change (example: Taher= 20) In this
example, we expressed a variable named (Taher) and its value is equal to (20),
where you can change the value of the variable while dealing with the program
immediately during the execution of the program.
69
ktabyeg.com
Dear student… When writing a variable name, you must take into account placing
the variable names in upper and lowercase letters (example: TAHER, Taher, taher,
TaheR) In the previous example, the variable names refer to four variables and not
one variable.
Types of variables in Python
1- Numbers: Used to store numerical values such as integers (int) and decimals
(float).
Integer variables:
X= 5
Y= 10
Decimal variables:
Z= 5.25
A= 8.32
2- Strings: Used to store texts such as names and addresses.
Texts are placed between single quotes ‘ ’ or double quotes “ ”
Name = “Taher”
City = ‘Cairo’
3- Booleans: A data type that contains only two values True or False
Often used in comparisons and decision making in codes
Is_taher_student = False
Is_taher_a_teacher = True
70
ktabyeg.com
Python program interface
1- Through the interactive Python interface (Python Shell): You can write
simple codes and execute them directly to see the results.
To know the type of the variable you can use the type ( ) function
71
ktabyeg.com
Simple Python Code Using Variables
The print function ( ) in Python is one of the most commonly used functions,
used to display text or values on the output screen. It can be used to display
text, variables, or even the results of mathematical operations.
Self-assess
72
ktabyeg.com
Learn by doing
Put a check mark () in front of the correct sentence and a check mark () in
front of the incorrect sentence.
1. Variables in programming languages are a reserved place in memory to store
and save a specific value. ( )
2. The variable name must not begin with a letter or an underscore sign _. ( )
3. TAHER, Taher, taher, TaheR are 4 names for variables in the Python
language. ( )
4. The change name contains letters (A-Z) or numbers or an underscore
sign _. ( )
5. When naming variables, reserved words in the Python language may be
used. ( )
6. Y= 10 The statement type of the variable Y is numeric for an integer. ( )
7. City = “Cairo” The statement type of the variable City is text. ( )
8. Is_taher_student = False The statement type of the variable Is_taher_student is
logical. ( )
9. To know the type of the variable, we do not need to use the type ( )
function. ( )
10.The texts of variables are placed between single quotation marks ‘ ’ or
double quotation marks “ ”. ( )
73
ktabyeg.com
2. The text value of the variable is placed between the signs .....
A. ""
B. <>.
C. >=.
D. =<.
4. To know the type of the variable statement, we use the function .....
A. Cos( )
B. Type( ).
C. Print( ).
D. Sin( ).
74
ktabyeg.com
Translation committee
75
ktabyeg.com