Fundamentals of programming Flashcards

Paper 1

1
Q

What is a data type?

A

A data type is defined by the values it can take or the operations which can be performed on it.

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

What is an integer?

A

A whole number, positive or negative, including zero.

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

What is a Real/Float?

A

A positive or negative number which can have a fractional part.

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

What is a Boolean?

A

A value that is either true or false.

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

What is a charater?

A

A single letter number or symbol

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

What is a string?

A

A collection of characters

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

What are pointers?

A

Ways of storing references.

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

Define Records.

A

A collection of fields, each of which could have a different data type.

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

What are arrays?

A

A finite, indexed set of related elements each of which has the same data type.

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

What are user defined data types

A

User-defined data types are derived from existing data types in order to create a customised data structure.

Creating and using user-defined data types allows a programmer to ensure that a solution is as memory efficient as possible.

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

What is variale declaration?

A

This is when you create a variable giving it a name, sometimes giving it a data type.

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

What is constant declaration?

A

This is the same as variable declaration but when declared, it doesn’t change while the program is running.

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

What is assignment?

A

This is when you give a constant or variable a value.

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

What is iteraton?

A

This is when an instruction is repeated over a certain period of time.

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

What is selection?

A

This is when values are compared and an action is taken based on those values.

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

Define Subroutine

A

It is defined as a block of code containing set of instructions.

17
Q

Arithmetic Operations in programming

A

–Real / Float
Represents division that results in a decimal (fractional) value.
–Division
When one value is divided by another, both a quotient and a remainder can be returned.
–Integer Division
Returns only the whole number part of the result.
Also known as DIV.
–Modulo
Returns the remainder of an integer division.
Also known as MOD.
–Exponentiation
Raising one value to the power of another.
–Rounding
Limits a number to a set degree of accuracy, such as a number of decimal places or significant figures.
–Truncation
Removes the decimal part of a number without rounding.
Always returns just the whole number part.

18
Q

Relational Operations

A
  • Equal to → =
  • Not equal to → <> or !=
  • Less than → <
  • Greater than → >
  • Less than or equal to → <=
  • Greater than or equal to → >=
19
Q

String-Handling Operations

You don’t have to know everything.

A
  • Length: Returns the number of characters in a specified string.
  • Position: Returns the position of a specified character within a string.
  • Substring: Given a starting position and a length, returns a portion of a string.
  • Concatenation: Joining two or more strings together to form a new, longer string.
  • Character to character code: Returns the character code which corresponds to a specified character.
  • Character code to character: Returns the character represented by a given character code.
  • String to integer: Converting a string to an integer.
  • String to float: Converting a string to a float.
  • Integer to string: Converting an integer to a string.
  • Float to string: Converting a float to a string.
  • Date/time to string: Converting a date/time data type to a string.
  • String to date/time: Converting a string to a date/time data type.
20
Q

What are local variables?

A

A local variable is a variable that can only be accessed from the subroutine within which it is declared.

21
Q

What are global variables?

A

Global variables can be accessed from any part of a program and exist in memory for the entire duration of the program’s execution.

22
Q

What is a recursive subroutine?

A

A recursive subroutine is a subroutine that calls on itself.

23
Q

What is a class?

A

A class is a blueprint for an object.

24
Q

What is an object?

A

They are instances of classes.