

20 Further Programming
Presentation
•
Computers
•
10th Grade
•
Practice Problem
•
Easy
ZUKO NDABAMBI
Used 2+ times
FREE Resource
24 Slides • 53 Questions
1
20.1 Programming Paradigms
20.2 File Processing and Exception Handling
2
Open Ended
Describe what is meant by an imperative (procedural) programming language. (2)
3
Imperative languages use variables
...which are changed using (assignment) statements
...they rely on a method of repetition / iteration.
The statements provide a sequence of commands for the computer to perform
...in the order written / given
...each line of code changes something in the program run.
4
Open Ended
Describe what is meant by a declarative programming language.(2)
5
Instructs a program on what needs to be done instead of how to do it
... using facts and rules
… using queries to satisfy goals.
Can be logical or functional
Logical - states a program as a set of logical relations
Functional – constructed by applying functions to arguments / uses a mathematical style
6
Multiple Choice
Identify the programming paradigm for the program code example (see image).
Declarative
Procedural / imperative
Low-level / assembly
Object oriented / (OOP)
7
Multiple Choice
Identify the programming paradigm for the program code example (see image).
Declarative
Procedural / imperative
Low-level / assembly
Object oriented / (OOP)
8
Multiple Choice
Identify the programming paradigm for the program code example (see image).
Declarative
Procedural / imperative
Low-level / assembly
Object oriented / (OOP)
9
Multiple Choice
Identify the programming paradigm for the program code example (see image).
Declarative
Procedural / imperative
Low-level / assembly
Object oriented / (OOP)
10
Fill in the Blanks
State the addressing mode used by
LDM.
Type answer...
11
Fill in the Blanks
State the addressing mode used by
LDD
Type answer...
12
Open Ended
Using opcodes from the table, write instructions to set the value at address 509 to the contents of address 500 added to the value 12.
13
LDM #12 [1]
ADD 500 [1]
STO 509 [1]
14
Open Ended
Describe what is meant by the term properties
15
the data items / attributes
the data types // characteristics
defined in a class
16
Open Ended
Describe what is meant by the term methods
17
the procedures/ functions / programmed instructions in a class / super class / base class
… implementing the behaviours
… that act on the properties / attributes
18
Open Ended
Describe what is meant by the term inheritance
19
Methods and properties / attributes contained in one class/ super class / base class
Are made available to / reused by another class/ derived class
20
Fill in the Blanks
Write the declaration in pseudocode for OwnerName as PRIVATE.
Type answer...
21
Open Ended
Explain why the properties have been set to PRIVATE
22
23
Fill in the Blanks
More facts are to be included. Sam studies history and Nina is his tutor.
Write the additional clauses to record these facts.
18.
Type answer...
24
Fill in the Blanks
More facts are to be included. Sam studies history and Nina is his tutor.
Write the additional clauses to record these facts.
19.
Type answer...
25
Fill in the Blanks
Write the result returned by the goal:
studies(Student, geography)
studies(Student, geography) =
Type answer...
26
Open Ended
Write the goal, using the variable X, to find all the students who have a tutor that teaches them. For example, Hua has Alan for a tutor and is also taught mathematics by Alan
27
28
Open Ended
State the reasons for including exception handling routines when writing a program. Include an example of an exception in your answer. (4)
29
30
Fill in the Blanks
The address 500 contains the value 100 and the address 100 contains the value 20.
State the contents of ACC after the following instruction has been executed.
LDM #500
Type answer...
31
Fill in the Blanks
The address 500 contains the value 100 and the address 100 contains the value 20.
State the contents of ACC after the following instruction has been executed.
LDD 500
Type answer...
32
Fill in the Blanks
The address 500 contains the value 100 and the address 100 contains the value 20.
State the contents of ACC after the following instruction has been executed.
LDI 500
Type answer...
33
Multiple Choice
Programs using the instruction set of a processor
Low-level
Object oriented
Imperative
Declarative
34
Multiple Choice
Programs using the concepts of class, inheritance, encapsulation and polymorphism
Low-level
Object oriented
Imperative
Declarative
35
Multiple Choice
Programs with an explicit sequence of commands that update the program state, with or without procedure calls
Low-level
Declarative
Imperative
None
36
Multiple Choice
Programs based on events such as user actions or sensor outputs
Low-level
Declarative
Imperative
None
37
Open Ended
Define these Object-Oriented Programming (OOP) terms (3):
a) Instance
b) Inheritance
c) Polymorphism
38
Instance – an occurrence of an object // a specific object based on the class // an instantiation of a class.
Inheritance – the capability of defining a new class of objects that has all the attributes and methods from a parent class.
Polymorphism – allows the same method to take on different behaviours depending on which class is instantiated // methods can be redefined for derived classes.
39
Fill in the Blanks
Write down answer for number 1
Type answer...
40
Fill in the Blanks
Write down answer for number 2
Type answer...
41
Fill in the Blanks
Write down answer for number 3
Type answer...
42
Fill in the Blanks
Write down answer for number 4
Type answer...
43
Fill in the Blanks
Write down answer for number 5
Type answer...
44
Fill in the Blanks
Write down answer for number 6
Type answer...
45
Fill in the Blanks
Write down answer for number 7
Type answer...
46
Open Ended
Define these Object-Oriented Programming (OOP) terms (3):
a) Encapsulation
b) Getter
c) Setter
47
One mark for each correct OOP term definition
Encapsulation – putting properties and methods inside a class // ensures sensitive data is hidden from users by hiding values of a structured data object inside a class.
Getter – method that is used to return the value of a property.
Setter – method that is used to update the value of a property.
48
Fill in the Blanks
Write down answer for number 1
Type answer...
49
Fill in the Blanks
Write down answer for number 2
Type answer...
50
Fill in the Blanks
Write down answer for number 3
Type answer...
51
Fill in the Blanks
Write down answer for number 4
Type answer...
52
Fill in the Blanks
Write down answer for number 5
Type answer...
53
Open Ended
Write assembly language instructions to set the contents of addresses 601 and 602 to zero, and set all four least significant bits of the contents of address 603 to one. Use the instruction set from Table 8.1 (3)
54
1 mark per bullet point
Storing 0 in 601 and 602
Loading the correct pattern for 603
… Storing in 603
LDM &00 /#0 / B00000000
STO 601
STO 602
LDM B00001111 /#15 /&0F
STO 603
55
Open Ended
Carlos is writing exception handling code for his program.
(a) State what is meant by an exception.(1)
56
It is an unplanned event // an event not wanted
57
Open Ended
Carlos is writing exception handling code for his program.
Give three situations where an exception handling routine would be required.(3)
58
1 mark per example to max 3 e.g.
Division by zero
Invalid array index
File does not exist
Run-time error
Invalid input
Invalid argument/value
Stack overflow
Memory leakage
Hardware failure/error
59
Open Ended
Carlos is writing exception handling code for his program.
Describe the benefits of using exception handling in a program.(2)
60
mark per bullet point to max 2
The program will not crash // more robust // program will continue
Result does not cause further errors/problems later
Appropriate error messages/result
Exceptional conditions are identified
Improve readability
61
Open Ended
Elle is a person who plays rugby but refuses to play hockey. Write additional clauses to represent this information. (4)
62
1 mark for each statement
person(elle).
sport(rugby).
plays(elle, rugby).
will_not_play(elle, hockey)
63
Fill in the Blanks
Elle is a person who plays rugby but refuses to play hockey. Write the result returned by the goal: plays(X, football).
Type answer...
64
Open Ended
Elle is a person who plays rugby but refuses to play hockey. Y might play X, if Y is a person, X is a sport and Y does not refuse to play X.
Write this as a rule.
mightplay(Y , X)
65
1 mark per bullet point
person(Y)
AND // ,
sport(X)
AND NOT // , NOT
will_not_play(Y, X)
mightplay(Y, X)
IF person (Y) AND sport (X) AND NOT(will_not_play(Y, X))
66
Open Ended
Object-oriented programming has several features. These include inheritance, classes, methods and properties
Identify two other features of object-oriented programming.
67
1 mark per feature to max 2
Polymorphism
Encapsulation
Containment
Aggregation
Composition
68
Open Ended
OWrite program code for the Constructor() method. Use the appropriate constructor method for your chosen programming language
69
def init(self, LType, LInstructor) :
self.__ LessonType = LType
self.__Instructor = LInstructor
70
Open Ended
Write program code for the GetLessonType() method
71
1 mark per bullet point
function header and close (where applicable)
returns Fee
def GetLessonType(self) :
return self.__LessonType
72
Open Ended
Write program code for the GetFee() method
73
1 mark per bullet point
Function header and close (where applicable)
Takes a parameter value
Check parameter value is valid …
… returns the correct fee
Returns -1 if value not valid
PYTHON
def GetFee(self, Level) :
if Level == 'B' : return 45
elif Level == 'I' : return 50
elif Level == 'A' : return 55
else : return -1
74
Open Ended
Write program code for the GetLessonType() method
75
1 mark per bullet point
Array declaration with identifier LessonArray and size 9
Correct data type used
DECLARE LessonArray : ARRAY[0:8] OF Lesson
76
Open Ended
The tennis club has the lesson ‘Improve Your Serve’ that has David as the instructor.
Write program code to create the lesson ‘Improve Your Serve’ as an instance of the class Lesson. The object needs to be stored in the third element of the array LessonArray
77
1 mark per bullet point
Object is created
Correct parameters passed
Stored in correct index of LessonArray
PYTHON
LessonArray[2] = Lesson("Improve Your Serve", "David")
20.1 Programming Paradigms
20.2 File Processing and Exception Handling
Show answer
Auto Play
Slide 1 / 77
SLIDE
Similar Resources on Wayground
76 questions
Grade 9 General Reading Revision Tri 1
Presentation
•
9th Grade
74 questions
9.1: The Issue of Slavery
Presentation
•
10th Grade
74 questions
Informatika kelas 9 bab 3
Presentation
•
9th Grade
73 questions
Macromolecules Part 1
Presentation
•
10th Grade
73 questions
Human Life Issues
Presentation
•
10th Grade
70 questions
TLE-ICT ILLUSTRATION
Presentation
•
10th Grade
70 questions
Berry - Gilded Age STAAR review
Presentation
•
11th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade