Teach 2.2.1 and 2.2.2

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

In deze les zitten 23 slides, met interactieve quizzen, tekstslides en 4 videos.

Onderdelen in deze les

Teach 2.2.1 and 2.2.2

Slide 1 - Tekstslide

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

Slide 2 - Tekstslide

Three types of programming construct

Slide 3 - Woordweb

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 vraag

Slide 8 - Video

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

Slide 9 - Open vraag

Examples of constants
VAT rate - 20%
Pi - 3.14159265359

Slide 10 - Tekstslide

What maths operators do you know?

Slide 11 - Woordweb

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

Slide 12 - Tekstslide

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 - Tekstslide

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

Slide 14 - Open vraag

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 - Tekstslide

Data types?

Slide 16 - Woordweb

Data Types
Integer
Real
Boolean
Character/String

Slide 17 - Tekstslide

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

Slide 18 - Quizvraag

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

Slide 19 - Quizvraag

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

Slide 20 - Quizvraag

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

Slide 21 - Quizvraag

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

Slide 22 - Quizvraag

Casting
Turning one datatype into another one when coding

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

Slide 23 - Tekstslide