Programming Concepts Flashcards
What is the difference between data and information?
Computers understand data whereas humans understand information. Computers have to convert information into data in order to process it.
What is a constant?
A constant is a value that can’t be changed while the program runs
What is a variable?
A variable is a value that can be changed by the program as it runs
Why is it important that variables have data types?
Because using the correct data type helps to avoid errors. For example, if a program incorrectly stored numbers using the data type ‘string’, and then attempted to carry out mathematical operations on the is data, it would prove impossible because text data cannot be manipulated in this way.
What are the advantages of using Boolean?
- Faster entry of data
- Less memory used
- Lower the chances of errors
What is a multi-dimensional array?
An array that can store more than one series of data in conjunction
What are the three common relational Boolean operators?
AND
OR
NOT
What does each operator mean?
A. =
F. >
A. Less than B. Less than or equal to C. Equal to D. Not equal to E. Greater than or equal to F. Greater than
What is a procedure?
A set of instructions that form a specific task as part of a larger program
What is the difference between a procedure and a function?
A procedure simply executes it’s statements and then returns control to the main program whereas a function also receives and sends values between the program and itself
Name and describe three built in functions in a language of your choice.
(C++)
Round- this rounds numbers up/down eg, Round(111.5) returns 112
Abs- this will return the number as a positive eg, Abs(-112) will return 112
Sqrt- this will return the square root of the number eg, sqrt(12544) will return 112
What is a parameter?
A value that is sent to a procedure or a function
What is a return value?
The data which functions send beck to the main program when they have finished their execution
Define scope
The range over a program in which a variable, constant, function or procedure can act
Give two types of functions with different scope
Public/global- can be called from anywhere in the program
Private/local- can only be called from an individual area of the program
What is an algorithm?
A series of steps or instructions that are followed in order to solve a problem
What is pseudo code?
Structured English that describes and algorithm, similar to the real code
Describe a sequence
When a set of instructions is executed in order
Describe a selection
When an option of statements is provided and a condition is used to decide which option was chosen
Describe an iteration
When a group of statements are repeated until a condition is met
What is a nested construct?
Using one programming construct within another eg, using a selection within and iteration
Describe what is meant by top down design
Solving problems by breaking them down into smaller problems.