Computer Science Paper 1 Definitions

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/50

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.

51 Terms

1
New cards

CONSTANTS

can't be changed and require no memory storage when the program runs.

2
New cards

STRUCTURED PROGRAMMING

involves creating named SUBROUTINES (functions in C#), that are called from the main program and exchange data through parameters. It avoids repetition, allows modular and reusable code, allows local variables (which only exist in the subroutine), is easier to test and helps produce programs that are clear and well documented.

3
New cards

Algorithm

Sequence of steps that can be followed to complete a task

A computer program is an implementation of an algorithm. An algorithm is not a computer program.

4
New cards

Decomposition

Breaking a problem into smaller sub-problems

5
New cards

Abstraction

Removing unnecessary detail

6
New cards

Assignment

Setting the value of a variable

7
New cards

Iteration

Repeating (looping) - either definite, which loops a fixed number of times, or indefinite, which can go on forever.

8
New cards

'Nested' iteration

One loop inside another

9
New cards

Selection

Choosing based on an IF statement

10
New cards

Syntax Error

Error (such as a typo) that prevents the program from running at all

11
New cards

Logic Error

Error that only appears when the program is run but does not do what is expected.

12
New cards

Authentication

Checking authorisation - e.g.: Username and password are correct.

13
New cards

Validation

Checking that data input follows certain rules, e.g.:

Minimum length
Nothing entered
Value between given range

14
New cards

LINEAR SEARCH

works through all the items in a list, starting from the beginning and ending when it finds what it's looking for or hits the end.

15
New cards

BINARY SEARCH

requires a sorted input. It splits the list in two, compares the middle value and chooses the upper or lower half. Keep repeating until the item is found or it's discovered that it can't be there (there's nowhere in the sorted list for it to be). It is more time efficient than linear search (but needs the data to be sorted)

16
New cards

BUBBLE SORT

work through the items from left to right, if they are the wrong way round, swap them and keep going. Keep repeating until there are no more swaps.

17
New cards

MERGE SORT

Split the input array in half, then do it again and again until you're left with just single items. Then merge the pairs of items together in the correct order, pair by pair until the sort is complete.

18
New cards

MERGE VS BUBBLE SORT

MERGE SORT is usually more time efficient than bubble sort. Time efficiency describes how long an algorithm will take in the worst-case scenario. The time taken is related to the size of the input, that relationship is the time efficiency. Every loop makes it worse, loops within loops are particularly troublesome.

19
New cards

WHILE loop

tests at the beginning

20
New cards

DO ... WHILE/REPEAT loop

tests at the end

21
New cards

difference between while and so while/repeat loop

WHILE loop may not loop at all, whereas a DO/REPEAT will always loop once

22
New cards

subroutine (function in c#)

named 'out of line' block of code that may be executed (called) by simply writing its name in a program statement.

Data can be passed in a subroutine through parameters

They can be used and reused by the program "calling" their name in a statement, causing it to be executed

23
New cards

VARIABLES

can be changed and requires memory storage when the program runs.

24
New cards

Understand the concept of a data type.

A means of classifying different data

Data type determines properties like what operations can be conducted on the data and how the data will be stored

25
New cards

Integer

A whole number

26
New cards

Real/float/double

Number with a fractional/decimal part

27
New cards

Bool

True or false

28
New cards

Character

A single letter, number or symbol

29
New cards

String

Zero or more characters. String can be null, just one character or many characters

30
New cards

MOD

remainder. 12 MOD 5 gives 2

31
New cards

DIV

how many times a number goes in. 17 DIV 5 gives 3

32
New cards

Data Structures

the ways of organizing and storing data in a computer. They allow related pieces of data to be grouped together and accessed efficiently.

33
New cards

length

tells you how many characters in a variable or how many elements in an array

variable.Length

34
New cards

position

finds the character corresponding to said position, first character counts as 0

string test = "doggy";
Console.WriteLine(test[2]);
outputs "g"

35
New cards

substring

part of an existing string

if 2 numbers first number is included, second number is not (stops at number before second number)

if 1 number starts from that number (inclusive) and goes until the end

string test = "Hello World";
string substr1 = test.Substring(0, 4); outputs "Hell"
string substr2 = test.Substring(6); outputs "World"

36
New cards

concatenation

Joining together two or more strings

string test = "doggy";
string test2 = "cat";
string test3 = test + test2;
Console.WriteLine(test3);

outputs doggycat

37
New cards

convert character to character code

char character = 'A';
int charCode = (int)character;
Console.WriteLine("Character: " + character);
Console.WriteLine("Character Code: " + charCode);

outputs
Character: A
Character Code: 65

38
New cards

convert character code to character

int charCode = 65; // ASCII code for 'A'
char character = (char)charCode;
Console.WriteLine("Character Code: " + charCode); Console.WriteLine("Character: " + character);

outputs:
Character Code: 65
Character: A

39
New cards

string to integer

string test = "1234";
int test2 = Convert.ToInt32(test);

40
New cards

string to real

string test4 = "1234.56";
double test5 = Convert.ToDouble(test);

41
New cards

integer to string

int t = 3456;
string tt = Convert.ToString(t);

42
New cards

real to string

double ttt = 34.5678;
string tttt = Convert.ToString(tt);

43
New cards

Be able to use random number generation.

Random r = new Random();
int rint = r.Next(1, 7);

generates a number between 1 and 6

44
New cards

Explain the advantages of using subroutines in programs.

Subroutines are usually small in size, which means they are much easier to write, test and debug. They are also easy for someone else to understand.

As they are written outside of the main program, subroutines can be saved separately as modules and used again in other programs. This saves time because the programmer can use code that has already been written, tested and debugged.

A subroutine may be used repeatedly at various points in the main program and changed by passing in data known as parameters. However, the code only has to be written once, resulting in shorter programs.

45
New cards

local variables

only exist while the subroutine is executing

are only accessible within the subroutine

46
New cards

parameters

used to pass data within programs

47
New cards

subroutines may declare their own _______, called _____ ________

subroutines may declare their own variables, called local variables

48
New cards

Understand what test data is and describe the following types of test data:
normal (typical)
boundary (extreme)
erroneous data.

normal data - data that the program should accept and be able to process

boundary data - valid data that falls at the boundary of any possible ranges

erroneous data - data that the program cannot process and should not accept

49
New cards

NOT

!=

50
New cards

AND

&&

51
New cards

OR

||