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