Download presentation
Presentation is loading. Please wait.
Published byDennis Lambert Modified over 6 years ago
1
For -G7 programing language Teacher / Shamsa Hassan Alhassouni
2
What we will Learn today?
Understand Flow chart – Algorithm and Pseudocode Understand text based games Understand Loops
3
Flow Charts & PSEUDOCODES
4
Flow Chart Flow Chart : is a diagram that shows a process , made up of boxes representing steps , decisions, input and output
5
Flow Chart
6
Activity / 1 Complete the flow chart using the following words: OUTPUT
Start Complete the flow chart using the following words: OUTPUT INPUT START STOP DECISION Output Stop
7
Response stored in variable
Activity /2 Enter a number Response stored in variable Is the num > 0 “number is positive” “number is negative” Yes No Complete the flow chart using the following words: OUTPUT INPUT START STOP DECISION
8
Response stored in variable
Activity /2 Enter a number Response stored in variable Decision Is the num > 0 “number is positive” “number is negative” Yes No Start Complete the flow chart using the following words: OUTPUT INPUT START STOP DECISION Output Input Output Output Stop
9
Algorithm Algorithm: is sequence of instructions that are followed to complete a task. Two ways to represent Algorithm: flow chart - pseudocode
10
Pseudocode Psedudocode: is a way to represent the flow chart. It is a simple way to describe set of instructions that doesn’t have syntax. In pseudocode, INPUT asks a question. Output prints a message on the screen.
11
Activity /3 Write down the Psedudocode of the following program:
12
Text Based Games
13
Text Based Games Text based games : games that uses characters instead of images and animations.
14
Loops
15
Iteration / Loops Iteration : is the process of repeating steps.
Two ways for Iteration : Count –controlled Condition controlled
16
Discover more through your practical activity
NO Task Completed Not Completed 1 Open the python edu 2 Select ‘the existing project named (grade7-1) 3 Click file > new > python file 4 Give the python file a name. (L8 - loop) 5 Type the following: 6 Run your program and discuss the output 10 The program will not end – it will stuck because the
17
Discover more through your practical activity
6 change your program and discuss the output now 7 Write a loop that displays numbers 10 to 100 in steps of 5 8 Challenge: Write a program to allow the user to enter his password, if the password is wrong, he will have 3 tries.. But if a correct password is entered, the program should end.. 10
18
Password Program Code To stop the program if the correct password is entered
19
How easy did find the today’s lesson in python?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.