Flashcards in U1T1 - Programming Deck (49)
What is a computer program?
A specific set of ordered
instructions to be performed by a computer.
The program represents a solution to a problem.
What does a computer require to function?
Where are program instructions executed?
In the CPU.
What is an IDE?
Integrated Development Environment. Combines a text editor with program-running functionality. Often includes features like debugging and text completion.
What is debugging?
Detecting, locating and correcting bugs (mistakes)., usually by running program. Run program using test data to fully test every part of program.
What is a bug?
Logic errors such as telling computer to repeat an operation but not how to stop repeating.
What is text completion?
Like predicted tense on phones. A.K.A. Intellisense.
Why do we need the translation process?
Computer system only understands machine code. i.e. program in python can't be run directly, it must be translated. Source code is translated. It becomes object code which is understood.
What does the translator in the translation process do?
Checks program syntax, giving diagnostics. Translates program into object code.
What are diagnostics?
What are the 3 main types of translators?
Assemblers, Compilers and Interpreters.
What is an assembler?
Converts assembly language mnemonics into machine code.
What does an interpreter do?
Converts each instruction of source code into object code as program is run. Better interactive environment, but slower. Program is translated each time it's executed.
What does a compiler do?
Converts entire source code into machine code so it can be run without further translation. Error correction is tedious.
What are the 3 main errors in programming?
Syntax, runtime and logical.
What is a syntax error?
Code doesn't follow rules of programming language. e.g. Missed bracket, no speech marks, spelling error.
What is a runtime error?
When program runs, error occur. e.g. trying to divide a number by o or open a nonexistent file.
What is a logical error?
Program runs but gives unexpected results. e.g. mathematical operators used incorrectly < rather than >, no brackets around a calculation.
What is an algorithm?
A recipe that describes the exact steps needed for the computer to solve a problem or reach a goal.
What is pseudocode?
A set of specific instructions which are very similar to computer code, but not specific to any one computer. Must write start and end.
What is a flowchart used for?
Clearly identify steps in a process that is to be programmed.
What is syntax?
Set of rules on how to use and organise statements in a programming language.
What are the commands used to do these functions in python?:
Whole Number Division
What is the order of operation in programming?
BIDMAS - Brackets, Indices, Division, Multiplication, Addition, Subtraction.
What are variables?
Reserved memory locations to store values.
What happens when you create a variable?
You reserve some space in memory.
Where must the data used in a program be stored whilst it's running?
In main memory.
What do we use for variables so we can refer to them in memory?
What does the name of a variable refer to?
What does each variable have and what does this determine?
What is necessary when we assign a value to a variable?
Location of data item in memory.
Data type, what we can do with the data + how much space it takes up in memory.
Variable name must be created before value is assigned.