U1T1 - Programming Flashcards
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?
Programs.
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?
Syntax-error messages.
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.