Programming Flashcards
Explain the need for meaningful identifiers
It allows people who are quickly skimming through your code, to see which areas of code correspond to which outputs instead of reading the whole code.
Define character
A character is a unit of information
What are assemblers used for?
To turn assembly language into machine code
Define integer
A data type that represents numerical values such as 10 or 15
Give some characteristics of high-level languages
One instruction represents many instructions of machine code
The same code will work for many different machines and processors
The programmer can easily store data in lots of different structures without knowing about the memory structure
Code is easy to read, understand and modify
Must be translated into machine code before a computer is able to understand it
You don’t have much control over what the CPU actually does so programs will be less memory efficient and slower
Explain a nested structure
One structure of code written inside another structure of code as a member of that structure
Define Boolean
The Boolean data type is a data type that has one of two possible values (usually true or false)
Give some characteristics of compilers
Translates all of the source code at the same time and creates one executable file
Only needed once to create the executable file
Returns a list of errors for the entire programs once compiling is complete
Once compiled, the program runs quickly but compiling can take a long time
Give some characteristics of low-level languages
One instruction of assembly code usually only represented one instruction of machine code
Usually written for one type of machine or processor and won’t work on any others
The program are needs to know about the internal structure of the CPU and how it manages the memory
Code is very difficult to read, understand and modify
Commands in machine code can be executed directly without the need for a translator
You control exactly what the CPU does and how it uses memory so programs will be more memory efficient and faster
Define real
Real numbers are numbers that include fractions/values after the decimal point
Give some characteristics of interpreters
Translates and runs the source code one instruction at a time, but doesn’t create one executable file
Needed every time you want to run the program
The interpreter will return the first error it finds and then stop - this is useful for debugging
Programs will run more slowly because the code is being translated as the program is running
What are the three types of translators?
Assemblers
Compilers
Interpreters
What are compilers and interpreters used for?
To turn high-level code into machine code
Explain indefinite iteration
This repeatedly executes a selection of code until a certain condition is met
Describe what is meant by data type?
A particular kind of data item, as defined by the values it can take, the programming language used or the operations that can be performed on it