Programming Fundementals Flashcards

(27 cards)

1
Q

What is a variable?

A

A: A named memory location that stores data which can change during the program.

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

What is a constant?

A

A: A value that cannot change while the program runs.

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

What is a data type?

A

A: The kind of data a variable stores, e.g., integer, real/float, Boolean, string, character.

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

What is an integer?

A

A: A whole number (e.g., 5, –3, 0).

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

What is a real/float?

A

A: A number with decimals (e.g., 3.14).

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

What is a Boolean?

A

A: A data type with two values: TRUE or FALSE.

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

What is a string?

A

A: Text or characters, e.g., “Hello”.

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

What is sequence?

A

A: Instructions executed one after another in order.

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

What is selection?

A

A: Making decisions using IF, ELSE, or CASE statements.

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

What is iteration?

A

A: Repeating code using loops (FOR, WHILE, REPEAT UNTIL).

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

What is a REPEAT UNTIL loop?

A

A: Repeats code until the condition becomes true (runs at least once).

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

What is a FOR loop used for?

A

A: Repeating code a set number of times.

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

What is a WHILE loop used for?

A

A: Repeating code while a condition is true.

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

What is a function?

A

A: A subprogram that returns a value.

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

What is a procedure?

A

A: A subprogram that performs a task but does not return a value.

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

What is a parameter?

A

A: A variable given to a subprogram (like an input).

17
Q

What is a global variable?

A

A: A variable that can be used anywhere in the program.

18
Q

Why are local variables preferred?

A

A: They prevent unexpected changes and make code easier to debug.

18
Q

What is a local variable?

A

A: A variable that exists only inside one subprogram.

19
Q

What is string concatenation?

A

A: Joining strings together, e.g., “Hello “ + “World”.

20
Q

What is string slicing?

A

A: Taking part of a string, e.g., name[0:3].

21
Q

What is an array/list?

A

A: A data structure that stores multiple items under one name.

22
Q

What is an index in an array?

A

A: The position of an item (usually starting at 0).

23
Q

What is SQL?

A

A: SQL (Structured Query Language) is a language used to store, manage, and manipulate data in relational databases. It includes commands like SELECT, INSERT, UPDATE, and DELETE to interact with tables.

24
What does the SQL SELECT command do?
A: SELECT is used to choose which columns you want to retrieve from a database table. Example: SELECT name, age;
25
What does the SQL FROM command do?
A: FROM tells SQL which table to take the data from. Example: SELECT name FROM Students;
26
Q: What does the SQL ORDER BY command do?
A: ORDER BY sorts the output in ascending (ASC) or descending (DESC) order. Example: SELECT name, score FROM Students ORDER BY score DESC;