⌨️Computer Science 2 Flashcards

1
Q

comp 2.1: what is decomposition

A

breaking the problem down into smaller parts to simplify it, the smaller problems can be called sub-problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

comp 2.1: what is a structure diagram

A

they are used to represent decomposition, they are divided into nodes, the smallest node contains one task

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

comp 2.1: what is algorithmic thinking

A

this is a way of finding a solution by finding the individual steps needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

comp 2.1: what is abstraction

A

where you remove the unnecessary details from a problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

comp 2.1: what is a linear search

A

this searches through a dataset and matches the first letter and then the next and the next until it finds a match

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

comp 2.1: what is a binary search

A

finds a midpoint in the data sees if what you want is higher or lower and then half again until it finds a match, only works in an ordered list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

comp: what is a logic error

A

it is an error in which an unexpected output occurs, they do not stop the program from working

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

comp: what is a trace table

A

it is a method of checking a program that involves going through it and recording each change in a new column of the table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

comp 2.4: how do transistors function

A

by using semicondctors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

comp 2.4: what component in the computer uses transistors to temporarily store data

A

the RAM (primary storage)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

comp 2.4: what are electrically controlled switches called

A

transistors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

comp 2.4: what are logic circuits composed of, where are they in the computer and what do they do

A

transistors, CPU and they perform calculations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

comp 2.4: what form logic gates or “switches”

A

transistors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

comp 2.4: how many transistors are in the CPU

A

3 bn

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

comp 2.4: true or false, logic gates selectively allow electrisity to flow

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

comp 2.4: what do logic gates form in the CPU

A

logic circuits that perform calculations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

comp 2.4: do you perform the operations in brackets first in Boolean order of operations

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Comp 2.4: what is this symbol in Boolean logic ^

A

It is AND

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Comp 2.4: what is this symbol in Boolean logic ¬

A

NOT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Comp 2.4: what is this symbol is Boolean logic V

A

It is OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

comp 2.4: what is the order of precedence for Boolean logic

A

Not, And, Or

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

comp 2.5: what is a HLL

A

it is a high level language and often resembles English, they can be very portable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

comp 2.5: what are the pros and cons of HLLs

A

pro: they often resemble English
con: they are not always as fast as they require more translation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

comp 2.5: what is an LLL

A

it is a low level language, they require less translation (lowe levels of abstraction from machine language)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

comp 2.5: what are compilers

A

they translate a whole code at once, errors do not stop the code from being compiled and will all show up when the compiling is done, they create an exicutable file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

comp 2.5: what is an interpreter

A

they translate high level code into executable programs one line at a time, they stop when they find and error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

comp 2.5: what is an assembler

A

they translate assembly code into binary, they run fast.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

comp 2.5: what is an IDE

A

Integrated development environments, they are software that facilitate software development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

comp 2.5: in terms of IDEs what are debug tools

A

error diagnostics that highlight errors in code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

comp 2.5: in terms of IDEs what are code editors

A

they allow code to be written

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

comp 2.5: in terms of IDEs what are translators

A

a program that converts source code into object code
they also facilitate the ‘RUN’ button

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

comp 2.5: what are the pros and cons of LLL

A

pros: faster, they need less translation
cons: they are hard to read

33
Q

comp 2.5: what are the pros and cons of Compilers

A

pros:
- they provide a list of errors and aren’t stopped by a single one
- this can make debugging easier
- they produce an executable program that can help to protect copyright
cons:
- they can be very slow

34
Q

comp 2.5: what are the pros and cons of Assemblers

A

pro:
- they only work on assembly language
- they provide direct control over the hardware
con:
- they are very difficult to use

35
Q

comp 2.5: what are 3 features of IDEs

A

debug tools, code editors, translators

36
Q

comp 2.5: what are 3 types of translators

A

compilers, interpreters, assemblers

37
Q

comp 2.2: in python, how do you find the length of a string

A

len(var)

38
Q

comp 2.2: in python, how do you return a string in upper case

A

var = “hi”
var.upper()
print(var)

39
Q

comp 2.2: in python, how to transform a string into lower case

A

var.lower()

40
Q

comp 2.2: in python, how do you return the 5th character of a string

A

print(var[4])

41
Q

comp 2.2: in python, how do you print characters 1 to 5 of a variable

A

var = “hello world”
print(var[0:4])
output is hello

42
Q

comp 2.2: in python, what is the code that allows you to open write to, append data(add a new file) and read a file

A

f = open(“myfile.txt”, “w”)
f.write(“hi”)
f = open(“myfile.txt”, “a”)
f.write(“hi”)
f = open(“myfile.txt”, “r”)
print(f.read())
f.close

43
Q

comp 2.2: what do you have to do after opening a file in python

A

close it (f.close)

44
Q

comp 2.2: what is does the SELECT function sql do

A

the field (column) of the text that you are selecting

45
Q

comp 2.2: what does the FROM function in sql do

A

it defines the table you are selecting from

46
Q

comp 2.2: what does the WHERE function do in sql

A

it defines the conditions that must be met for the data to be returned

47
Q

comp 2.2: what does the ORDER BY function do in sql

A

it orders the returned data in an order, either asc(ascending) desc(descending) order

48
Q

comp 2.2: what does the AND function do in SQL

A

it adds a condition that must be met for the data to be returned

49
Q

comp 2.2: what does WHERE LIKE “A%”

A

return anything where the first letter is A% can be followed by anything.

50
Q

comp 2.2: what is casting

A

it is the process of change one form of data into another

51
Q

comp 2.2: how do you do a single line comment in python

A

#

52
Q

comp 2.2: how do you do a multi line comment in python

A

”””
comment
“””

53
Q

comp 2.1: how is the dataset divided in a binary search

A

by using integer division which is dividing without including a fractional part 8/ 3 = 2 not 2.6666

54
Q

comp python: how do you write a number to the power of another

A

num1 ** num2

55
Q

comp python: how do you figure out if a number is even or odd

A

if number % 2 == 0 then its even

56
Q

comp: what is a zero indexed array

A

the first item is an index of zero

57
Q

comp 2.2: how d you do integer division in python

A

//

58
Q

comp 2.1: what is a bubble sort

A

first 2 items are checked, they are swapped if the are in the wrong order, then this process repeats until the end of the items. Then this process is repeated until the set is sorted

59
Q

comp 2: what is a function

A

a piece of code that can be called from anywhere that returns a value

60
Q

comp 2: what is a procedure

A

it is a piece of code that can be called from anywhere and does not return a value

61
Q

comp 2.1: what is an insertion sort

A

it is a sort where the first point is entered and then the next and then the next in order until the set is sorted.

62
Q

comp 2.1: what is a merge sort

A

2 ordered lists are taken, these lists are then split into lists of size one, the size one lists from the ordered lists are compared and ordered, then the 2 lists are compared and again until the list is sorted.

63
Q

comp 2.1: what does a merge sort sort

A

it merges together 2 lists

64
Q

comp 2.1: what are the pros and cons of a merge sort

A

pros:
- efficiency
cons:
- can be slower
- needs more memory

65
Q

comp 2.1: what are the pros and cons of an insertion sort

A

pros:
- easy to implement
- little memory
cons:
- inefficient

66
Q

comp 2.1: what are the pros and cons of a bubble sort

A

pros:
- easy to implement
- little memory
cons:
- inefficient

67
Q

comp 2.3: what is defensive design

A

it is an approach to software development by which program is designed to be robust

68
Q

comp 2.3: what is a robust program

A

it is a program that can handle unexpected inputs without crashing or without being manipulated into malicious actions

69
Q

comp 2.3: what is validation

of inputs

A

it making sure inputs meet a certain criteria

70
Q

comp 2.3: what is sanitation

of inputs

A

the removal of unwanted characters from a dataset

71
Q

comp 2.3: what is authentication

A

it is the process of checkung whether a certain used should be able to access a certain system

72
Q

comp 2.3: what are contingencies

A

planning for contingencies such as a user accesing un assigned systems

73
Q

comp 2.3: what is an exeption

A

rather than letting a program crash, an error can be “thrown” and can be “caught” and handled instead of making the program crash

74
Q

comp 2.3: what is itterative testing

A

it is testing while a code is being developed

75
Q

comp 2.3: what is terminal testing

A

it is testing at the end of development

76
Q

comp 2.3: what is a runtime error

A

they are errors that happen while the code is running

77
Q

comp 2.3: what is blackbox testing

A

testing where the tester does not know the internal structure of a program

78
Q

comp 2.3: what is whitebox testing

A

testing where the tester does know the internal structure of a program