⌨️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 discards the unneeded side 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 semiconductors

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
comp 2.5: what are compilers
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
26
comp 2.5: what is an interpreter
they translate high level code into executable programs one line at a time, they stop when they find and error
27
comp 2.5: what is an assembler
they translate assembly code into binary, they run fast.
28
comp 2.5: what is an IDE
Integrated development environments, they are software that facilitate software development
29
comp 2.5: in terms of IDEs what are debug tools
error diagnostics that highlight errors in code
30
comp 2.5: in terms of IDEs what are code editors
they allow code to be written
31
comp 2.5: in terms of IDEs what are translators
a program that converts source code into object code they also facilitate the 'RUN' button
32
comp 2.5: what are the pros and cons of LLL
pros: faster, they need less translation cons: they are hard to read
33
comp 2.5: what are the pros and cons of Compilers
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
comp 2.5: what are the pros and cons of Assemblers
pro: - they provide direct control over the hardware con: - they are very difficult to use - they only work on assembly language
35
comp 2.5: what are 3 features of IDEs
debug tools, code editors, translators
36
comp 2.5: what are 3 types of translators
compilers, interpreters, assemblers
37
comp 2.2: in python, how do you find the length of a string
len(var)
38
comp 2.2: in python, how do you return a string in upper case
var = "hi" var.upper() print(var)
39
comp 2.2: in python, how to transform a string into lower case
var.lower()
40
comp 2.2: in python, how do you return the 5th character of a string
print(var[4])
41
comp 2.2: in python, how do you print characters 1 to 5 of a variable
var = "hello world" print(var[0**:**4]) output is hello
42
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
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
comp 2.2: what do you have to do after opening a file in python
close it (f.close)
44
comp 2.2: what is does the SELECT function sql do
the field (column) of the text that you are selecting
45
comp 2.2: what does the FROM function in sql do
it defines the table you are selecting from
46
comp 2.2: what does the WHERE function do in sql
it defines the conditions that must be met for the data to be returned
47
comp 2.2: what does the ORDER BY function do in sql
it orders the returned data in an order, either asc(ascending) desc(descending) order
48
comp 2.2: what does the AND function do in SQL
it adds a condition that must be met for the data to be returned
49
comp 2.2: what does WHERE LIKE "A%"
return anything where the first letter is A% can be followed by anything.
50
comp 2.2: what is casting
it is the process of change one form of data into another
51
comp 2.2: how do you do a single line comment in python
#
52
comp 2.2: how do you do a multi line comment in python
""" comment """
53
comp 2.1: how is the dataset divided in a binary search
by using integer division which is dividing without including a fractional part 8/ 3 = 2 not 2.6666
54
comp python: how do you write a number to the power of another
num1 ** num2
55
comp python: how do you figure out if a number is even or odd
if number % 2 == 0 then its even
56
comp: what is a zero indexed array
the first item is an index of zero
57
comp 2.2: how do you do integer division in python
//
58
comp 2.1: what is a bubble sort
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
comp 2: what is a function
a piece of code that can be called from anywhere that returns a value
60
comp 2: what is a procedure
it is a piece of code that can be called from anywhere and does not return a value
61
comp 2.1: what is an insertion sort
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
comp 2.1: what is a merge sort
A list 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
comp 2.1: what does a merge sort sort and how
it sorts a list of numbers, by repeatedly dividing it into smaller sublists then merging those sublists back together into a single sorted list
64
comp 2.1: what are the pros and cons of a merge sort
pros: - efficiency cons: - can be slower - needs more memory
65
comp 2.1: what are the pros and cons of an insertion sort
pros: - easy to implement - little memory cons: - inefficient
66
comp 2.1: what are the pros and cons of a bubble sort
pros: - easy to implement - little memory cons: - inefficient
67
comp 2.3: what is defensive design
it is an approach to software development by which program is designed to be robust
68
comp 2.3: what is a robust program
it is a program that can handle unexpected inputs without crashing or without being manipulated into malicious actions
69
comp 2.3: what is validation | of inputs
it making sure inputs meet a certain criteria
70
comp 2.3: what is sanitation | of inputs
the removal of unwanted characters from a dataset
71
comp 2.3: what is authentication
it is the process of checking whether a certain used should be able to access a certain system
72
comp 2.3: what are contingencies
planning for contingencies such as a user accesing un-assigned systems
73
comp 2.3: what is an exeption
rather than letting a program crash, an error can be "thrown" and can be "caught" and handled instead of making the program crash
74
comp 2.3: what is itterative testing
it is testing while a code is being developed
75
comp 2.3: what is terminal testing
it is testing at the end of development
76
comp 2.3: what is a runtime error
they are errors that happen while the code is running
77
comp 2.3: what is blackbox testing
testing where the tester does not know the internal structure of a program
78
comp 2.3: what is whitebox testing
testing where the tester does know the internal structure of a program
79
comp: what is a variable
it is a piece of data with an identifier and that can change while a program is running
80
comp 2.1: what do structure diagrams look like
81
comp 2.2: how to cast data as a string or int
str(data) int(data)
82
comp 2.2: what is a constant
it is a piece of data that does not change
83
Comp 2: what does the line do in a flow diagram
It represents the flow between each part of the diagram
84
Comp 2: what does the square do in a flow diagram
it is a process
85
Comp 2: what does this do in a flow diagram
Represents the start or end of a process
86
Comp 2: what does this do in a flow diagram
it is selection (if)
87
Comp 2: what does this do in flow diagram
It calls a suborutine
88
What does this do in a flow diagram
It is an input or output operation
89
Comp 2: What is a real (number)
A float (decimal)
90
Comp 2: what is null data (in error testing)
It is where no data is entered
91
Comp 2: what is erronius data (in error testing)
It is the wrong data altogether
92
Comp 2: what is invalid data (in error testing)
It is data not within the acceptable range or of an invalid format
93
Comp 2: what is valid data (in error testing)
Correct data
94
Comp 2: what is casting
It is changing data from one type to another
95
comp 2.1: what is selection
it is where a piece of code is only executed if/when a condition is met
96
comp: why must files be handled in the way that they must
to prevent accidentally corrupting them
97
comp: how do you close a file in python
f.close()
98
comp: what is structured data
it is that resides within a fixed field in a record, this makes it easy for the data to be entered, stored, queried, and analyzed
99
comp: when editing files what does write (**'w'**) do in python
it overwrites the entire file
100
comp: when editing files what does write (**'a'**) do in python
it adds to the file
101
comp: what is a condition shape in flowcharts
102
comp: what is an input/output shape in flowcharts
103
comp: what is a process shape in flowcharts
104
comp: what is a start/end shape in flowcharts
105
Comp: what is the sign for not equal to
!=
106
Comp: what is the sign for equal to
==
107
Comp: what is the sign for less than or equal to
<=
108
Comp: what is the sign for less than
<
109
Comp: what is the sign for greater than
>
110
Comp: what is a runtime environment
special software that allows a program to run on a computer, even if it is not designed to run on it
111
Comp: what is a test plant
It keeps track of possible tests that will be run on a system after coding, check
112
Comp: what is normal data
Data that can be accepted by a program without causing errors (logic or syntax)
113
Comp: what is boundary data
It is data on the edge of the accepted range
114
Comp: what are 4 ways of keeping code maintainable
- using sub-programs - naming conventions - indentation - commenting
115
Comp: what is input validation
Making sure an input meets required criteria
116
Comp: what are 2 conventions of defensive design
- anticipating misuse - authentication
117
Comp: why is commenting useful
To help other coders understand what you are doing
118
Comp: what is authentication
Confirming the identity of the user and making sure that they should have access
119
Comp: how do you concatenate in python
A = "hello" B = "world" C = A + B Print(C) = hello world
120
Comp: what is slicing in python
The extraction of a part of a list, **string** or tuple
121
Comp: how to slice hello from a = "hello world" in python
Print(a(0:4))
122
Comp: what are prerequisites for an algorithm
They are things needed for an algorithm to run, check
123
Comp: what is the operator for quotient
DIV
124
Comp: what is the quotient of 42 and 6
42 / 6 = 7