4.1.1 - FoP (Programming) Flashcards

(22 cards)

1
Q

Define Data type

A

An attribute of data that determines what sort of data is being stored and how it will be used

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

Define Integer

A

A data type for storing positive or negative whole numbers

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

Define real/float

A

A data type for storing numbers with decimal values

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

Define Boolean

A

A data type that can only store one of two possible values

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

Define Character

A

A data type for storing a letter, number or special character.

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

Define String

A

A data type for storing a sequence of characters or symbols

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

Define Date/Time

A

A data type for storing date or time values

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

Define records

A

A data structure that stores related data items in elements called fields

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

Define Array

A

A data structure for a finite, indexed set of elements of the same data type

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

What is a pointer/reference type

A

Data type which are stores for memory addresses of objects created at runtime, dynamically.

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

Define user-defined data types

A

Custom data types designed by the user by combining existing data types, for the bespoke needs of their program

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

Define language defined data types

A

Data types built in to a programming language

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

Define Subroutines(Procedures/Functions)

A

a named ‘out of line’ block of code that may be executed (called) by
simply writing its name in a program statement.

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

Why is it important to use meaningful identifier names

A
  • Makes code easier to understand
  • Makes code self-documenting (Describes the logic of the code as its developed)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some advantages using named constants

A
  • Makes code easier to understand compared to using hard coded values
  • Because it is immutable if it is to be modified, it is only to be done in one place, making it easier to debug program.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are some advantages of using subroutines

A

1 - Reduces repition of code , as it can be reused making code more compact
3 - Easier to debug as subroutines can be tested independently from the whole program
4 - Faster development of large problems as the can be decomposed.

17
Q

How do subroutines use parameters

A

parameters are taken in by a subroutine, and these are required for the subroutine to run

18
Q

What is are the features of a local variabes

A

1 - One that exists while the subroutine is excecuted
2 - One that is only accessible within the subroutine

19
Q

Why is it good practice to use local variables

A
  • They exist only during subroutine execution so are more memory efficient
  • Easier to debug as they can only be exist in the subroutine and not all over the program
20
Q

What is a stack frame

A

A data structure that stores the return addressess, parameter and local variables when subroutines are called

21
Q

What is a recursive routine

A

A subroutine that calls itself in its definition

22
Q

In java what does Math.random() do (include bounds)

A

returns a random number between 0.0 (inclusive), and 1.0 (exclusive):