1.8 Programming Q Flashcards
Purpose of computer program
Specific set of ordered instructions to be performed by a computer.
Program represents solution to a problem.
Execute 1 introduction at a time (in sequence)
Can be written in high level language c#
Can be written in low level machine code
How IDEs used to create computer programs
Program code created using code editor.
Code then translated into machine code.
Source code not be executed unless fully compiled.
IDEs provides programmers with facilities required to complete development from coding to testing.
IDE consist of..
IDEs consist of
Source code editor - can enter code
Compiler- program can run
Debugger- error correction as u enter code
GUI- intuitive interface
Solution explorer- view files associated w program.
Describe 2 examples of how IDEs help SW developers in the production of error free code
Debugging- can be used to detect and correct problems automatically if commands incorrect.
Syntax error assistance- as code entered
Code editor will place wavy line beneath code incorrect or cause problem.
What happens when an IDE debuts program
IDE works through the program in a systematic way
Finds code that is not producing accurate results.
Debugger used to detect and correct these issues.
Can set breakpoints where the program will stop during execution, allowing programmer to view results at that stage and examine code.
How breakpoints used in production of computer program
Programmer set point which code stop executing (otherwise run until end)
Allows results of processing to be examined at breakpoint.
If program does not run programmer can use breakpoints to find sections of source code do not contain errors by allowing them to run up to breakpoint.
Role of an interpreter during process of translation
Translates SC one line at a time.
Processor executes one line of code before moving into next.
No version of machine code is stored.
Role of compiler during translation
Convert whole program at once into machine code before executing it.
Syntax of each statement is checked.
If incorrect, compiler will generate list of errors.
Cannot be executed unless all syntax errors removed.
C+C role played by interpreters and compilers in translating source code
Similarities
BOTH are translating source code into machine code for computer to understand
BOTH will not execute code if contains syntax errors.
C+C role played by interpreters and compilers in translating source code.
Differences
INTERPRETER translates one line of code at a time.
COMPILER translates whole program at one time.
Execution time slower w INTERPRETER
COMPILER does not identify which line of code contains an error.
INTERPRETER does not run the line of code if there is an error.
What is an algorithm
Set of rules for a computer program.
Carried out in order.
Represent solution to a problem.
Can break down any problem into a series of ordered steps.
Role of syntax in creation of computer program
Set of rules that govern how statements should be structured.
Each programming language has own unique syntax.
Syntax errors are identified during process if translation.
Specifies how commands should be used to create statements.
Statements make up source code.
What is meant by count controlled loop
Variable is used to control number of times instruction carried out.
Variable known at “loop counter” to set an initial value of counter.
Each time loop executed, counter is incremented.
Sequence carried out SET NO. OF TIMES.
What is meant by iteration
Ability to repeat line of code many times.
Expressed through loops.
Iteration= each time a repeated instruction is carried out.
Objects
Instance of a class
Stores data about a person or thing.
Can perform actions and interact with other parts of program.