Data types Flashcards

1
Q

What is an algorithm?

A

• An algorithm is a set of rules or a sequence of steps specifying how to solve a problem, independent of any programming language.

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

What do all algorithms have?

A
  • Input
  • Processing
  • Output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an integer?

A

Positive or negative whole numbers

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

What is a real/float?

A

Stores numbers with decimal places/values

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

What is a character?

A

Letters, numbers and special characters typically represented in ASCII.

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

What is a string?

A

• Stores alphanumeric combinations and texts, group of characters.

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

What is a variable?

A
  • Variable are identifiers given to memory locations whose contents will change during the course of the program.
  • Variable is a storage location, identified by a memory address paired with an associated symbolic name ( Identifier ) which contains information referred to as the value.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an identifier?

A

User defined name of the programming element.

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

What is a constant?

A
  • Constant is a value that cannot be altered by the program during normal execution, the value would therefore be constant.
  • Variable is an identifier with a value that can be changed during normal execution, i.e. the value is variable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the advantages of using constants?

A
  • In a long, complex program there is no chance a programmer will accidentally change its value by using the identifier for a different purpose.
  • It is far more efficient to change the value of a constant, as the programmer does not have to search through the program to find all the lines where the value was changed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly