mocks dont know Flashcards

1
Q

why use meaningful identifier names

A

variables make sense
names of subroutine tells the reader what it it
makes code easier to understand
makes code easier to debug and maintain

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

why use subroutines

A
  • each subroutine can be tested separately - making it easier to debug
  • many programs can work on a large program once - cutting down development time (splitting it up)
  • subroutines can be reused - reducing development time
  • code broken down into meaningful subroutines - easier to maintain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

position

A

POSITION(word, ‘r’)
word.index(‘r’)
word.find(‘r’)
finds position of a letter

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

substring

A

slices a string

  • SUBSTRING(start, end, str)
    e.g. word = algorithm
    SUBSTRING (3,6,word) = “orit”
  • print(word[3:7]) (stops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

subroutine definition

A

it is a named out of line block of code that may be executed by writing its name in a program statement

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

comparing linear and binary searches

A

binary
- in order
- start at middle
- halve set, compare middle item then discard one side, repeat
- suitable for a large no. items
- new items added in the correct place not end

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

computer virus

A

installed on users computer without their knowledge or permission, to do harm
can copy itself automatically

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

trojan

A

pretends to be of a helpful use to the user but is really malicious
may spread malware, crash computer, corrupt data, access sensitive info

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

spyware

A

software that gathers info about a person or an organisation without their knowledge
can collect personal info such as logins

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

firewall

A

monitors incoming/ outgoing network traffic
decides what to block/allow based on rules
can block certain IP addresses or ports

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

MAC address filtering

A

determines which devices are allowed to access a network
by whitelisting certain permitted devices (identified by their MAC address)

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

application layer

A

where network applications operate
data is encoded
- HTTP, HTTPS, FTP, IMAP, SMTP

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

transport layer

A

sets up communication between two hosts
and establishes settings eg language and packet size
splits data into packets
- TCP and UDP

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

link layer

A

where network hardware is located eg NIC and OS device drivers
attaches MAC addresses of the sender/ receiver

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

internet layer

A

addresses packages for transmission
routes packages across the network
attached IP address of sender and destination
- IP

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

layers order

A

A
T
I
L

17
Q

ethernet protocol

A

family of related protocols
communicate by sending each other individual data frames
the MAC address specifies the source and destination of each frame

18
Q

wifi protocol

A

allows electronic devices to connect to a WLAN
the Wireless Access Point receives data from a network
the transmitter converts this into radio waves
which are received by a device

19
Q

TCP

A

defines how messages are broken into packets and reassembled
detected errors and resends lost packets

20
Q

UDP

A

connectionless transmission model
can send messages to other hosts on an IP network
like TCP but has no error checking and maintains an open connection - gaming/ streaming

21
Q

IP

A

identifies the location of the device on a network (the internet) and routes the packets from source to destinations via routers

22
Q

FTP

A

used to transfer files between a client and server. based on a client server model and uses separate control and data connections between the client and server

23
Q

SMTP

A

for sending emails between servers over the internet

24
Q

IMAP

A

receiving email
stores email on server but
allows user to view it on many devices

25
Q

POP

A

receiving email
downloads new message to local device (no longer on server)

26
Q

character set

A

a list of the characters and the binary codes used to represent each one
eg ASCII or UNICODE

27
Q

importance of local variables

A
  • keeps subroutine self contained
  • subroutines can be used as part of a larger program without variables interfering
  • save memory
  • program easier to maintain/ debug
28
Q

how are packets used to send data across internet

A
  • website data broken down into packets
  • each packet is numbered
  • given recipient and sender IP address
  • sent separately
  • takes most efficient route
  • reassembled at destination
  • checked for errors
  • lost packets resent
29
Q

benefits of layers

A

each layer is self contained
can be changed individually
layers can have different software/ hardware
network areas can be split between developers