1. Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the 5 common data type?

A

Integer
Real/Float
Character
String
Boolean

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

What are the Arithmetic operators?

A

Less than <
Greater than >
Less than or equal to <=
Greater than or equal to >=
Not equal to <> or !=
Equal to ==

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. What are the rules for creating a trace table?
A

They are used to check your algorithm gives the wanted output.

  1. A column is needed for each variable and a column for the output.
  2. Start a new row every time you need to declare a variable change.
  3. If the variable doesn’t change or is a constant keep it the same throughout the table or keep it same at the top and leave the column blank.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a subroutine and what are the two types?

A

A section of code that performs a specific task that can be used over and over again.
Functions and Procedures.

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

What is the difference between a function and a procedure?

A

A function is called upon and returns a value.
A procedure is also called and also can have parameters but doesn’t return a value.

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

Why do we use functions and procedures.

A

they are used so that code doesn’t become too long (decomposition). using parameters means that the code can be reused over and over again. Helps with decomposition.

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

What is a method?

A

Name for a subroutine normally in a class/OOP.

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

What are the 3 types of scopes?

A

Global
Local
Variable

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

What is global scope?

A

The variable is recognised throughout the code and can be used at anytime.

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

What is local scope?

A

variable only recognised in small area of code, e.g. subroutine.

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

What is variable scope?

A

Variable is recognised as being able to be called in that small section of code.

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

What is ASCII?

A

Stands for American Standard Code for Information Interchange and contains 128 characters for the majority of languages.

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

What is Unicode?

A

Stands for Universal Character Encoding that uses 4 bytes per character and with the first 128 characters being the same as ASCII is compatible.

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

What is the difference between ASCII and Unicode?

A

Unicode3 can represent more characters and languages including emojis, ASCII uses 7 bits and Unicode uses 8 bits.

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

Why is data represented in binary?

A

Easier to understand and manufacture, therefore more reliable and cheaper.

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

What is an array?

A

zero based, fixed length (static), store elements of one data type, that are held in contiguous memory, 1D/2D/3D accessed using index (each elements position in the array is known as its index).

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

What are the 3 common bases for numbers?

A

Binary (base 2).
Denary (base 10).
Hexadecimal (base 16).

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

Why do we use hexadecimal?

A

They provide a human friendly representation of binary coded values, each hex digit is 4 binary digits, it is easier therefore to work with hexadecimal.

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

How do you declare an array in pseudocode?

A

array example [row][column]

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

What is the length of the number of rows in a 2D array?

A

example.length

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

What is the length of the number of columns in a 2D array?

A

example[0].length

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

What is the difference between an argument and a parameter?

A

A parameter is a variable name used in the subroutine.
An argument the exact value is passed into a subroutine.

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

What is a file?

A

Data that is stored in which it occurs.
Write - either create a new file or append to the end of the file line by line.
Read - start at the top of the file and move down the file line by line.
You cannot read and write to a file at the same time.

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

What is the pseudocode for printing all the lines from a file?

A

myFile = openRead(“sample.txt”)
while NOT myFile.endOfFile()
print(myFile.readLine())
endwhile
myFile.close()

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

What is the pseudocode for writing one line to a file?

A

myFile = openWrite(“sample.txt”)
myFile.writeLine(“Hello World”)
myFile.close()

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

What is the pseudocode for reading one line from a file?

A

myFile = openRead(“test.txt”)
line = myFile.readLine()
myFile.close()

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

In HTML what is a class?

A

Used to style multiple elements - defines equal styles for elements

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

In HTML what is an identifier (ID)?

A

Singular version of class

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

What is HTML stand for?

A

HyperText Markup Language

30
Q

What is a CSS?

A

Cascading Style Sheets determine how HTML elements are displayed on the screen/paper/other media. The CSS is the appearance of the HTML.

31
Q

What is a Record?

A

A group of related fields under on identifier.
Can have different data types.
Used in conjunction with arrays or lists.

32
Q

What is a List?

A

A collection of data items in a sequence withour any gaps.
Accessed via index.
Data can be different types and can add or be deleted at any point in the list.
Lists are dynamic, they can grow and shrink.

33
Q

What is the difference between an array and lists?

A

Lists can be any type of data, and are dynamic, arrays are the opposite and are the same data type.

34
Q

What are the similarities between arrays and lists?

A

They are both indexed starting from 0.

35
Q

What are tuples?

A

Immutable list which cannot be changed during processing.
Different data types.
Good for data that doesn’t change in size or content.
Like a constant list.

36
Q

What does it mean when a number is represented through, fixed point representation?

A

Represents real numbers that uses a defined number of bits for the whole and fractional part.

37
Q

What is an advantage of fixed point?

A

We can state the accuracy (the number of bits after the point) we are using.

38
Q

What is a disadvantage of fixed point?

A

They cannot always represent all the numbers that is needed, more fractional or whole parts needed. Loss of accuracy.

39
Q

Represent the denary value 6.5 as an unsigned binary fixed point number, with 4 bits before and 4 bits after the binary point.

A

0110.1000

40
Q

Represent the denary value -3.125 as a signed binary fixed point number, with 4 bits before and 4 bits after the binary point.

A

1100.1110

41
Q

What does normalised floating point have?

A

Certain amount of bits for the Mantissa and Exponent.

42
Q

What does normalised floating point have?

A

Certain amount of bits for the Mantissa and Exponent.

43
Q

What is the difference between fixed point and normalised floating point?

A

Floating point can change the position of the bullet point due to the mantissa allowing more numbers to be represented, increased accuracy.

44
Q

Using normalised floating point binary representation using 8 bits for the mantissa and 4 for the exponent, represent the denary value -6.5.

A

10011000 0011

45
Q

Convert the normalised floating point binary number to denary 01011010 0011

A

0101.1010 = 5.625

46
Q

What is encapsulation?

A

All of the object’s attributes are contained and hidden in the object by giving them the private access modifier.
Accessed through public getter and setter methods.

47
Q

What is instantiation?

A

The process of creating an instance of a class.

48
Q

What is a class?

A

A blueprint for creating an object.

49
Q

What is an attribute?

A

A specific piece of data representing a particular characteristic of an object.

50
Q

What is a constructor?

A

A method that is called when creating an instance (object) of a class.

51
Q

What is an object?

A

An instance of a class.

52
Q

What is OOP?

A

A programming model/pattern which classifies real world objects into classes and encapsulates the object’s attributes and behaviours.

53
Q

What are the Methods?

A

Getters/Setters or other subroutines that define the behaviour odf the object.

54
Q

What is the difference between public and private access modifiers?

A

Private means that the attribute or method can not be accessed by code in another class while public means it can.

55
Q

University

  • name: String
  • ranking: int

+ new (givenName : String, givenRanking : int)
+ getName() : String
+ getRanking() : int
+ setName(newName: String) : void
+ setRanking(newRanking : int) : void

Use the class diagram below to create the class definition in pseudocode.

A

class University

private name
private ranking

public procedure new(givenName, givenRanking)
	name = givenName
	ranking = givenRanking
end procedure

public function getName()
	return name
end function

public function getRanking()
	return ranking
end function

public procedure setName(newName)
	name = newName
end procedure

public procedure setRank(newRanking)
ranking = newRanking
end procedure

end class

56
Q

What is primary storage/memory?

A

Directly accessible by the CPU and is the RAM and the ROM.

57
Q

What is secondary storage/memory?

A

Non-volatile memory that isn’t directly accessible by the CPU.

58
Q

What is virtual storage/memory?

A

Storage that seems to be local but is actually physically located elsewhere.

59
Q

What is magnetic storage?

A

Magnetic storage media and devices store data in the form of tiny magnetized dots. These dots are created and read using magnetic fields created by very tiny electromagnets.
Data can be stored on the upper and lower surfaces of each platter.

60
Q

How is data acccessed in magnetic storage?

A

Via a magnetic read/write head while the platter spins.

61
Q

Pros of magnetic storage?

A

High capacity.
Good reliability despite not being robust.
Low cost per unit capacity, making it a very economical choice.

62
Q

Cons of magnetic storage?

A

HDD has moving parts but can be subject to wear and tear. Not robust, can be damaged by shocks.

63
Q

What is the operating system?

A

System software that manages computer hardware and software. held in secondary storage.

64
Q

What are elements of an OS?

A

File, device, memory and network management.
Utilities
User interface
Security
Scheduling and Interrupts.

65
Q

What is paging?

A

Physical memory (RAM) is divided into fixed sized blocks called pages.
Page can be placed in any available space.
Easy to allocate/swap as everything is the same size.

66
Q

What is Segmentation?

A

Programs to be broken up into smaller address spaces; each can have its own type of protection and can be shared amongst other processes. Size is not fixed.

67
Q

What is disk Threshing/Trashing?

A

When the computer “freezes” and occurs as a result of pages being swapped too frequently between the hard disk and main memory.

68
Q

Pros of Paging?

A

Efficient use of physical memory.
Non contiguous allocation of memory.

69
Q

Cons of Paging?

A

Increased in page faults, which can slow down the system.

70
Q

Pros of Segmentation?

A

Dynamic allocation of memory.
More efficient use of memory.

71
Q

Cons of Segmentation?

A

Slower performance due to overhead involved in managing segment tables.
More complex.