

J277 2.3, 2.4 and 2.5 recap
Presentation
•
Computers
•
9th - 10th Grade
•
Practice Problem
•
Medium
Ollie Woods
Used 3+ times
FREE Resource
24 Slides • 42 Questions
1
2.3, 2.4 and 2.5 Revision
2
What's in 2.3?
Producing Robust Programs
Defensive design: Validation, verification, authentication
Maintainability
Testing: types, plans, data
Refining algorithms
3
Open Ended
Why do we want to make the programs we code as robust as possible?
4
Reasons for defensive design
Anticipating misuse
Making the program idiotproof! (probably best not to say that in an exam)
5
Validation
Making sure data entered into a program is reasonable and follows the rules the program needs it to follow!
For instance, say I want a user to enter their phone number...
6
Open Ended
What characteristics of a valid phone number could we validate in our program?
7
Types of validation
Range check - number/date is within an allowed range
Type check - data type is correct
Length check - not too long, not too short
Presence check - someone actually wrote something!
Format check - e.g. an email address or a postcode
8
Fill in the Blanks
Type answer...
9
Multiple Choice
What type of validation would be used on a field to enter a mobile phone number to ensure it contains 11 digits
Spell check
Lookup table
Presence check
Length check
10
Multiple Choice
What type of validation would be used on a field to check that data has been entered?
Spell check
Lookup table
Presence check
Length check
11
Multiple Choice
What type of validation is used to check that a value falls within the specified range
Spell check
Range check
Presence check
Length check
12
Verification
Making sure something has been typed in properly
Usually checked by making them type the thing in again!
13
Authentication
Making sure a user is who they say they are
This stops someone from accessing things they shouldn't be able to see!
14
Multiple Choice
Which one of these is NOT a form of authentication?
Password
Biometric (Face/Touch ID)
2FA
Typing your password in twice
15
Multiple Choice
Verification is important because...
It stops the program from crashing
You might type something wrong the first time and then you're locked out forever
It makes sure the correct user is using the program
It's important to make our code robust
16
Open Ended
How can we make sure that someone can't just keep trying passwords until they guess it correctly?
17
Writing maintainable programs
Programs need to be easy to understand... and also to edit
Other programmers may end up working on your code!
18
Methods of maintaining programs
Subprograms (functions and procedures)
Naming conventions
Indentation
# Comments
19
Multiple Select
Tick two methods to provide information for future users or programmers that may be required to maintain the code.
Complex code
Indentation
Comments
Concise variable name
20
Fill in the Blanks
Type answer...
21
Multiple Choice
Rowan has used the variable "playeronescore" in his program. Which of the following is the correct way of rewriting this in camel case?
PlayerOneScore
playeroneScore
playerOneScore
playerOnescore
22
Multiple Choice
Comments affect the code when it is run.
True
False
23
Open Ended
What's the difference between a function and a procedure in Python?
24
A mistake has been made when writing the program which causes unexpected results or behaviour.
The program will still run.
Logic error
The code written does not match the grammatical rules of the programming language.
The program will not run.
Syntax error
Errors
25
Multiple Choice
What type of error is this:
name = input("Enter your name)
print(name)
Syntax error
Logic error
There is no error
26
Open Ended
There is a logic error with the following code:
average = total * items
What is the logic error?
27
Tests...
How do we find errors?
28
Happens at the end of development.
Makes sure the program does what it's meant to and that all bugs are squashed!
Final/terminal testing
Happens throughout the development process.
Testing each new piece of code as it's written.
Iterative testing
Two types of test
29
Types of test data
Normal data: Fits within the expected range
Boundary data: On the edge (in or out!) of the expected range
Invalid data: Outside of the expected range
Erroneous data: Completely wrong data type!
30
Multiple Choice
A game asks a user to pick a number between 1 and 100.
Which one of these answers is normal test data?
67
345
0
"One hundred"
31
Multiple Choice
A game asks a user to pick a number between 1 and 100.
Which one of these answers is boundary test data?
67
345
0
"One hundred"
32
Multiple Choice
A game asks a user to pick a number between 1 and 100.
Which one of these answers is invalid test data?
67
345
0
"One hundred"
33
Multiple Choice
A game asks a user to pick a number between 1 and 100.
Which one of these answers is erroneous test data?
67
345
0
"One hundred"
34
Poll
How confident do you feel with 2.3?
Really confident
Confident enough
Not sure
Not confident
I need a lot more help!
35
What's in 2.4?
Boolean Logic
Logic gates
Truth tables
Problems with multiple logic gates
36
Fill in the Blanks
37
Multiple Choice
38
Both inputs have to be on/1/TRUE in order for the output to be on/1/TRUE.
AND gate
39
Multiple Choice
40
Either input can be on/1/TRUE in order for the output to be on/1/TRUE. If both are on/1/TRUE
OR gate
41
Multiple Choice
42
The input is inverted:
On becomes Off
Off becomes On
NOT gate
43
Open Ended
What do we use to record all of the possible combinations of inputs and outputs for a logic circuit?
44
Multiple Choice
Which gate is this the truth table for?
AND
OR
NOT
45
Problems with multiple gates
Identify the inputs.
Identify the output.
Identify the gates!
Write/draw out the circuit.
Create and fill in the truth table - there should be (2 to the power of inputs) rows in the table.
46
Multiple Select
Tick all the inputs in this question:
In order for the lights to come on in the living room, the light switch must be turned on or there must be movement detected by the proximity sensor.
Lights
Light switch
Movement
Proximity Sensor
47
Multiple Choice
Which logic gate is required in this circuit?
AND
OR
NOT
48
Multiple Select
Identify the inputs in this logic circuit:
Customers have to be 15 years of age or older to see the film. They also need to either have a ticket or have the money to buy a ticket.
Age >= 15
See the film
Ticket
Money
49
Multiple Select
Tick all the gates required for the circuit:
Customers have to be 15 years of age or older to see the film. They also need to either have a ticket or have the money to buy a ticket.
AND
OR
NOT
50
Fill in the Blanks
Type answer...
51
Poll
How confident do you feel with 2.4?
Really confident
Confident enough
Not sure
Not confident
I need a lot more help!
52
What's in 2.5?
Programming Languages and IDE
High and low level languages
Translators
Purpose and features of an IDE
53
Multiple Choice
What type of language is Python?
High level
Low level
Assembly language
Machine code
54
Python is a high level language.
High level languages are close to English in syntax
This makes them easier for humans to read, write, understand and debug
High level languages often have multiple processor commands per line of code.
They must be translated into machine code to run.
55
Multiple Select
What type of language is this:
LDA 43
(tick multiple!)
High level
Low level
Assembly language
Machine code
56
LDA 45 is an example of assembly language.
This is a low level language that uses mnemonics.
Low level languages are closer to (or are!) the binary code that computers understand.
Different processor brands (Intel, AMD, ARM) use different codes.
One line of code performs one processor command.
57
Multiple Select
What type of language is this:
0010 1100
(tick multiple!)
High level
Low level
Assembly language
Machine code
58
0010 1110 is an example of machine code
This low level language is the binary code that the computer understands.
It is hard for humans to understand but those who can use it are able to control the processor with great precision!
59
Fill in the Blanks
Type answer...
60
Code is translated line by line
Errors flag immediately
You always need the source code and interpreter to run
Interpreter
All the code is translated at once
Errors are found at the end
Code is converted into an executable file
Compiler
Two types of translator
61
Multiple Choice
What sort of translator does IDLE use?
Compiler
Interpreter
62
Multiple Choice
All the games you play on your phones, computers and consoles use this type of translator.
Compiler
Interpreter
Assembler
63
Fill in the Blanks
Type answer...
64
Open Ended
What's the point in using an IDE over, say, Notepad?
65
Features of an IDE
Syntax highlighting - key words, variables etc in different colours
Runtime environment - I can run my code!!!
Error diagnostics - tells me what's wrong with my code
Translator built in
Code editor
Stepping, code folding and variable value listing
66
Poll
How confident do you feel with 2.5?
Really confident
Confident enough
Not sure
Not confident
I need a lot more help!
2.3, 2.4 and 2.5 Revision
Show answer
Auto Play
Slide 1 / 66
SLIDE
Similar Resources on Wayground
61 questions
Modal Verbs
Presentation
•
10th Grade
57 questions
NPA Digital Media (Video) - Camera functions
Presentation
•
10th Grade
61 questions
Error Intervals
Presentation
•
9th Grade
58 questions
Ecology
Presentation
•
9th Grade
60 questions
Present, Future, Past Continuous
Presentation
•
9th Grade
58 questions
Secondary Storage
Presentation
•
9th Grade
62 questions
Vocabulary Unit II EP. II
Presentation
•
10th Grade
61 questions
review family and friend 2 hk2
Presentation
•
KG - 10th Grade
Popular Resources on Wayground
20 questions
"What is the question asking??" Grades 3-5
Quiz
•
1st - 5th Grade
20 questions
“What is the question asking??” Grades 6-8
Quiz
•
6th - 8th Grade
10 questions
Fire Safety Quiz
Quiz
•
12th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
34 questions
STAAR Review 6th - 8th grade Reading Part 1
Quiz
•
6th - 8th Grade
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
47 questions
8th Grade Reading STAAR Ultimate Review!
Quiz
•
8th Grade
Discover more resources for Computers
20 questions
“What is the question asking??” English I-II
Quiz
•
9th - 12th Grade
10 questions
Fire Prevention
Quiz
•
9th - 12th Grade
24 questions
BIOLOGY STAAR REVIEW
Quiz
•
9th Grade
50 questions
STAAR English 2 Review
Quiz
•
10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
30 questions
English 1 STAAR Review
Quiz
•
9th Grade
46 questions
Linear and Exponential Function Key Features
Quiz
•
9th Grade