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 2.1: what is a bubble sort

A

a bubble sort is a sort that orders a list by letting the things floaty to the top

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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
9
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
10
Q

comp 2.4: how do transistors function

A

by using superconductors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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
20
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
21
Q

Comp 2.4: what is this symbol is Boolean logic V

A

It is OR

22
Q

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

A

Not, And, Or

23
Q

comp 2.5: what is a HLL

A

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

24
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

25
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)

26
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

27
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

28
Q

comp 2.5: what is an assembler

A

they translate assembly code into binary, they run fast.

29
Q

comp 2.5: what is an IDE

A

Integrated development environments, they are software that facilitate software development

30
Q

comp 2.5: in terms of IDEs what are debug tools

A

error diagnostics that highlight errors in code

31
Q

comp 2.5: in terms of IDEs what are code editors

A

they allow code to be written

32
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

33
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

34
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

35
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

36
Q

comp 2.5: what are 3 features of IDEs

A

debug tools, code editors, translators

37
Q

comp 2.5: what are 3 types of translators

A

compilers, interpreters, assemblers

38
Q

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

A

len(var)

39
Q

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

A

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

40
Q

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

A

var.lower()

41
Q

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

A

print(var[4])

42
Q

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

A

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

43
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

44
Q

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

A

close it (f.close)

45
Q

comp 2.2: what is does the SELECT function sql do

A

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

46
Q

comp 2.2: what does the FROM function in sql do

A

it defines the table you are selecting from

47
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

48
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

49
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

50
Q

comp 2.2: what does WHERE LIKE “A%”

A

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