do it now activity correct the 8 syntax errors: age = input(“how old are you?” if age = 10...

14
KEYWORDS Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

Upload: vincent-jones

Post on 22-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

Do it now activityCorrect the 8 syntax errors:

Age = input(“How old are you?”

If age = 10Print(You are 10”)

else:print(“You are not 10”)

Page 2: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

LEARNINGOBJECTIVES

Homework PseudocodeYou will be given a home learning sheet to complete for homework this term.

Complete challenge 2

Your teacher will explain what you need to do.

Due:

Page 3: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

EXAMPLE PSEUDOCODE

Page 4: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

Understand how to use nested if statements in your programming

AIM

Page 5: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

1. Use nested if, elif, else function

2. Correctly identify the flow of data through a program

LEARNING OBJECTIVES

Page 6: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

LEARNING OUTCOMES

ALL(Level 4)

I know the difference between, and appropriately I can use if and if, then and else statements.

MOST(Level 5)

I can use a range of operators and expressions e.g. Boolean, and applies them in the context of program control.

SOME(Level 6)

I can use nested selection statements.

By the end of this lesson you will be able to ....

Page 7: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

LEARNINGOBJECTIVES

1. Use nested if, elif, else function2. Correctly identify the flow of data through a program

NestedSelection statement

IfElseElif

ConditionBooleanNegation

New Learning

Can you identify who did the crime?

Page 8: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

LEARNINGOBJECTIVES

New LearningDownload and investigate the program called ‘nested selection statements’ from www.Y8computing.weebly.com Term 4 Lesson 5

1. Use nested if, elif, else function2. Correctly identify the flow of data through a program

NestedSelection statement

IfElseElif

ConditionBooleanNegation

Page 9: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

LEARNINGOBJECTIVES

Independent taskCan you adapt the code to:Check if the user has entered a correct username and password?Username = Dsmith Password = teapot

Can you use negation for this?

1. Use nested if, elif, else function2. Correctly identify the flow of data through a program

NestedSelection statement

IfElseElif

ConditionBooleanNegation

Page 10: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

LEARNINGOBJECTIVES

Independent taskYou can use and to check if more than one statement is true ie

if name == “Dave” and age == 12:

Can you use this in your program?

1. Use nested if, elif, else function2. Correctly identify the flow of data through a program

NestedSelection statement

IfElseElif

ConditionBooleanNegation

Page 11: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

Copy Keyword

LEARNINGOBJECTIVES

Nesting: When control structures are inserted within other control structures.

Copy Keyword

1. Use nested if, elif, else function2. Correctly identify the flow of data through a program

NestedSelection statement

IfElseElif

ConditionBooleanNegation

Page 12: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

LEARNINGOBJECTIVES

1. Why did you need to create a nested selection statement for this task?

2. Why did you need to create an else statement that was outside of the nesting?

Talk task

1. Use nested if, elif, else function2. Correctly identify the flow of data through a program

NestedSelection statement

IfElseElif

ConditionBooleanNegation

Page 13: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

KEYWORDS

Plenary

LEARNINGOBJECTIVES

Three stars and a wish.

1. Use nested if, elif, else function2. Correctly identify the flow of data through a program

NestedSelection statement

IfElseElif

ConditionBooleanNegation

Page 14: Do it now activity Correct the 8 syntax errors: Age = input(“How old are you?” If age = 10 Print(You are 10”) else: print(“You are not 10”)

LEARNING OUTCOMES

ALL(Level 4)

Explain the difference between, and appropriately I can use if and if, then and else statements.

MOST(Level 5)

Use a range of operators and expressions e.g. Boolean, and applies them in the context of program control.

SOME(Level 6)

Use nested selection statements.

I can ....