Paper 3 May/June 2021

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

10 Terms

1
New cards

Describe the purpose of a user-defined data type.

  • To create a new data type (from existing data types)

  • To allow data types not available in a programming language to be constructed // To extend the flexibility of the programming language

2
New cards

Explain how an interpreter executes a program without producing a complete translated version.

  • An interpreter examines source code one statement at a time

  • Check each statement for errors

  • If no error is found the statement is executed

  • If an error is found this is reported and the interpreter halts

3
New cards

Explain why Reverse Polish Notation (RPN) is used to evaluate expressions.

  • Reverse Polish Notation provides an unambiguous method of representing an expression

  • Reading from left to right

  • Without the need to use brackets

  • With no need for rules of precedence / BODMAS

4
New cards

Identify a data structure used to evaluate an expression in RPN, with a reason.
A:

Structure: stack
Reason: The operands are popped from the stack in the reverse order to how they were pushed

5
New cards

Explain the use of graphs to aid Artificial Intelligence (AI).

  • Artificial Neural Networks can be represented using graphs

  • Graphs provide structures for relationships

  • AI problems can be defined as finding a path in a graph

  • Used in machine learning

6
New cards

Give two benefits and two drawbacks of packet switching.

Benefits:

  • Accuracy – Ensures accurate delivery of the message

  • Completeness – Missing packets can be easily detected and a re-send request sent so the message arrives complete

  • Resilience – if a network changes the router can detect this and send the data another way to ensure it arrives

Drawbacks:

  • Time delays to correct errors // Network problems may introduce errors in packets

  • Requires complex protocols for delivery

  • Unsuitable for real time transmission applications

7
New cards

State two factors that may affect the performance of a sorting algorithm.

  • The initial order of the data

  • The number of data items to be sorted

  • The efficiency of the sorting algorithm

8
New cards

Describe what is meant by an imperative (procedural) programming language

  • Imperative languages use variables

  • Which are changed using (assignment) statements

  • They rely on a method of repetition

9
New cards

Describe what is meant by a declarative programming language.

  • 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

10
New cards

Identify the programming paradigms for each of the following program code examples.

  • male(john).

  • FOR Counter = 1 TO 20

  • LDD Counter …

  • public class Vehicle …

  • male(john). → Declarative

  • FOR Counter = 1 TO 20 → Procedural / imperative

  • LDD Counter … → Low-level / assembly

  • public class Vehicle … → Object oriented / (OOP)