CS Flashcards

1
Q

Describe the process of compiling an app:

A

A compiler permanently translates all of the source code into machine code instructions, identifying all of the errors in the code at the end of the translation.

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

Explain how a computer system organises memory:

A

Each piece of data is stored in a separate location which has it’s own unique address

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

What is the purpose of concatenation?

A

It joins 2 strings together

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

State why predefined functions are used in testing:

A

Because if a predefined functions is used there is no need to code your own solution, therefore it is more time efficient

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

Describe how extended ASCII code is used to represent characters.

A

Extended ASCII uses a code to represent characters as an 8-bit number, each character is given a different number to represent it

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

What does GDPR state about data which is being stored in databases?

A

GDPR states that data should be limited to that needed for the declared purpose.

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

How would you code to find out the number of items in an array?

A

event = [“hurdles”, “sprinting”, “high jump”]
Print(“there are”, len(event), “events”)

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

What bus is uni-directional (only can go in one direction):

A

Address bus (PROCESSOR —> MEMORY)

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

What bus is bi-directional? (Can go in both directions)

A

The data bus

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

What is the code for importing random items from a 1-d array?

A

Import random
chararray=[“A”, “B”,”C”, “D”,”E”, “F”,”G”, “H”,”0”, “1”,”2”, “3”, “4”]
number=[0]*6
passcode=””

for counter in range(6):
number= random.randint(0,12)
passcode = (passcode + chararray[number])
print(passcode

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

What does the data bus do?

A
  • carries data from memory to be used by the processor
  • carries data from the processor to be stored in memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the address bus do?

A

-tells memory which memory location is being read from
-tells memory which memory location is being written to

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

Code the random function with an array:

A

Import random
Seats = [true, false, true, true, false]
SeatNumber = random.randint(1,60)
While Seats[SeatNumber] = false:
SeatNumber = random.randint(1,60)
Seats[SeatNumber] = false

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