Unti1 Computational Thinking TeacherShamsa Alhassouni Lesson Objectives o
Unti-1 Computational Thinking Teacher/Shamsa Alhassouni
Lesson Objectives: o Define computational thinking o Draw flow charts o Use of comments in python o Understand variables - datatypes and python operators. Teacher/Shamsa Alhassouni 2
Teacher/Shamsa Alhassouni
1. Computational Thinking Teacher/Shamsa Alhassouni 4
Discuss How to make a cup of coffee: Teacher/Shamsa Alhassouni
Discuss How to make a paper Airplane? Teacher/Shamsa Alhassouni
Discuss How to calculate a rectangle room size? Teacher/Shamsa Alhassouni
Discuss How to make a fish aquarium? Teacher/Shamsa Alhassouni
Algorithm Teacher/Shamsa Alhassouni
Algorithms An Algorithm is a set of rules or steps used to solve a problem. Steps of Programming Process Design an algorithm Analyze Problem Use the program Implement algorithm Teacher/Shamsa Alhassouni Test your algorithm
Flow Chart • A flow chart is a diagram that shows the steps used to solve a problem • Flow chart uses standard symbols to represent the different instructions Teacher/Shamsa Alhassouni
Teacher/Shamsa Alhassouni
Challenge 1: § Write an algorithm and design the flow chart for the following case: The sum of two numbers Teacher/Shamsa Alhassouni
Challenge 2: § Write an algorithm and design the flow chart for the following case: Mariam got a land in a square shape , with an L Length and intended to sell the land by X price for single square meter. What will be the price of the land ? Teacher/Shamsa Alhassouni
Book Activity P-31 & 32 Teacher/Shamsa Alhassouni 15
Book Activity Page 32 Teacher/Shamsa Alhassouni
2. Comments Teacher/Shamsa Alhassouni 17
Comments # Comments are used to write descriptive comments to help you debug and share codes. Practical Task • Open python program and create new python file called “Lesson 2” • Use comments tag to write your name • Your class Teacher/Shamsa Alhassouni
3. Variables Teacher/Shamsa Alhassouni 19
36980 + 12555 Teacher/Shamsa Alhassouni
Variable & Data Type A variable is a named location in computer’s memory that is used to store data. • Each variable has a name and a value. • The name of the variable should not start with a number or a symbol. • The name of the variable should represent the data you be storing num Teacher/Shamsa Alhassouni 21
Book Activity P-35 - 36 Teacher/Shamsa Alhassouni
Practical Task • Open python program - “Lesson 2” • Type the following: name = input(“Enter Your Name” ) print (“Hello” , name) Ask the user to enter age and then print Your age is … Teacher/Shamsa Alhassouni
4. Python Operators Teacher/Shamsa Alhassouni 24
Python Operators are the instructions that tell the computer what to do with the data - (Mathematical Operators) Operand num=17 Total = num + 293 Operator Operands data that we are working with to perform operations Teacher/Shamsa Alhassouni 25
Arithmetic Operators Teacher/Shamsa Alhassouni
5. Data Types Teacher/Shamsa Alhassouni 27
Data Type Data types are used to classify the data used in a computer program. Teacher/Shamsa Alhassouni
Activity Work in pair. . And ask your colleague the following questions. . 1. What’s your name ? 2. How much do you expect today’s temperature ? 3. What is the value of PI ? Teacher/Shamsa Alhassouni
Data Types Floating Point integer byte short int long float character double string Definition Operations can be carried out Example Integer (int) Whole numbers (positive and negative) + , - , *, / , %, ** 380 , -200 Float (float) Decimal numbers (positive and negative) + , - , *, / , %, ** 2. 6 , -9. 1 String (string) Characters / letters declared between “ “ + “Year” , “Zayed” Teacher/Shamsa Alhassouni
End of Unit Activities Teacher/Shamsa Alhassouni
- Slides: 31