Programming Flashcards Preview

A-Level Computer Science OCR > Programming > Flashcards

Flashcards in Programming Deck (107)
Loading flashcards...
1

Why is it necessary to have a variety of programming languages?

- different languages suit different jobs
- developers prefer certain languages

2

computer program

a series of instructions that are executed one after another.
follow the pattern: INPUT -> PROCESS -> OUTPUT

3

3 programming constructs

sequence, selection, iteration

4

Sequence

do one statement after another in the correct order

5

Selection

do a set of statements based on conditions allow your code to make choices- otherwise known as branching

6

iteration

do a set of statements again and again (looping)

7

count controlled loops

repeat a set number of statements a fixed number of times

8

condition controlled time

repeat a set number of statements until a condition is met

9

Variable

a name refer to a particular memory location that is used to store data. The value of the data held in that memory location is not known when the program is written and can change while the program is running

10

constant

name used to refer to a fixed value. The value is set when the code is written and cannot change while the program is running

11

procedure

a self-contained set of commands that can be called from different parts of the program. returns 0 or many values.

12

function

a sub-routine that make take one or more parameters and ALWAYS returns a value

13

uses of functions and procedures

breaking a problem into manageable sections
preventing duplicating sections of code when it is needed more than once in a program

14

why is manageable code important

easy to read, debug and easy to maintain

15

\

integer division

16

AND

if both inputs are true the output is true else the output is false

17

OR

if both inputs are true or one input is true the the output is true else the output is false

18

NOT

reverses the outcome of the expression

19

assignment operator

single equals, sets the value on the right equal to the value on the left

20

procedural language

programming languages where the user gives step by step instructions of what to do

21

assembly language

a low level language represented by mnenomics which represents the machine code. one-to-one relationship with machine code.

22

programming paradigm

a way to classify programming languages based on their features.

23

3 programming paradigms

`procedural
Object Orientated
Assembly

24

why can assembly code for one processor not work for another processor

each type of processor has its own unique instruction set

25

Load instruction

LDA

26

store instruction

STA

27

input instruction

INP

28

Output instruction

OUT

29

end instruction

HLT

30

data storage instruction

DAT