Teach 2.2.1 and 2.2.2

Teach 2.2.1 and 2.2.2
1 / 23
next
Slide 1: Slide
ComputingUpper Secondary (Key Stage 4)GCSE

This lesson contains 23 slides, with interactive quizzes, text slides and 4 videos.

Items in this lesson

Teach 2.2.1 and 2.2.2

Slide 1 - Slide

Question the Answer
Can you write the question to these answers!!

Slide 2 - Slide

Three types of programming construct

Slide 3 - Mind map

Slide 4 - Video

Slide 5 - Video

Slide 6 - Video

Question this Answer --> A value that can change, usually when the program is running

Slide 7 - Open question

Slide 8 - Video

So what is this then --> An item of data that will not change during the program execution

Slide 9 - Open question

Examples of constants
VAT rate - 20%
Pi - 3.14159265359

Slide 10 - Slide

What maths operators do you know?

Slide 11 - Mind map

Maths operators
+  -  *  /
MOD
DIV
Exponential (to the power of)

Slide 12 - Slide

MOD and DIV
DIV works out full divisions
10 DIV 3 = 3     (because 3 fits three times)
In python this looks like 10//3

MOD works out remainder after division
10 MOD 3 = 1 (because 1 left after all 3s accounted for)
In python this looks like 10%3

Slide 13 - Slide

So what does that leave 10**2 to do in python?

Slide 14 - Open question

Computers are stupid
They don't know what kind of data you are giving it.
It needs to know the format of that data to store it correctly.
These are called datatypes

Slide 15 - Slide

Data types?

Slide 16 - Mind map

Data Types
Integer
Real
Boolean
Character/String

Slide 17 - Slide

What would you use to store a first name
A
String
B
Real
C
Integer
D
Boolean

Slide 18 - Quiz

What would you use to store a phone number
A
String
B
Real
C
Integer
D
Boolean

Slide 19 - Quiz

What would you use to store a price of a product?
A
String
B
Real
C
Integer
D
Boolean

Slide 20 - Quiz

What would you use to store whether the customer qualifies for a discount?
A
String
B
Real
C
Integer
D
Boolean

Slide 21 - Quiz

What would you use to store how many children you have?
A
String
B
Real
C
Integer
D
Boolean

Slide 22 - Quiz

Casting
Turning one datatype into another one when coding

EG
x = input("how old are you?")
if int(x)>=18:
     print("Adult")

Slide 23 - Slide