Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Definition
Computer
Is a programmable electronic device that can process, store and retrieve data and/or information.
Program
Computer Programmer
The person who creates computer program. Requirement: analysis, logic, knowledge w/ programming language to use
Purpose: to analyze thoroughly to understand the problem to identify the inputs and outputs
7
Inputs:
7,8,3,2,1
Process
7+8+3+2+1
Output
SUM
10
11
Tools
Flowcharting Pseudocode
false code involves actually writing a program, written in English rather than in a computer language.
12
Flowcharting
A flowchart is a pictorial representation of an algorithm or logical steps. Each step is represented by a symbol and the arrows indicate the flow and order of the steps. The shape of the symbol indicates the type of operation that is to occur. Flowcharts may help the more visual students learn and understand logic.
13
Flowchart Symbols
Input or Output
Begin or End
Processing
Decision
Output subtotal
End
16
True
If weight < 10
Handling = 1.00
Output Handling
17
18
19
Example: Flowcharting
START
SUM = 7 + 8 + 3 +2 +1
END
20
This step involves translating the algorithm into a formal programming language.
21
Programming Process
Compile Errors?
Run-Time Errors?
Create/Edit Program
Source Program
Compile Program
Object Program
Execute Program
22
Output Average
printf(the Average is %d, Average);
23
Program Compilation
This is the phase where the programmer makes sure that there is no violation on the rules of programming language
Compiler
reads entire source code the converts it to object code, which then it is now executed by the computer
Interpreter
reads source code one line at a time, and perform the specific instruction contained in one line
24
Error Classification
Syntactical, (logical errors) Compile, (run-time errors)
26
ERRORS
Syntactical Errors are due to failure from following the syntax of a particular language. Syntax refers to the grammatical rules of the language defining its legal constructs. Logical Errors are difficult to identify. Such errors may occur during the formulation of algorithm, wrong analysis of the problem or the approach of the programmer on finding the right answer to the problem
27
Compile-time Errors halt the compilation of the program. Compilation means translating the program codes into a form that the physical computing machine can understand. Run-time Errors are errors that appear during the execution of the program. Once the program starts running, it means that the program is already free from syntax errors and compilation has already been successfully finished
28
Documentation
The programmer gathers all the materials generated during each step. The detailed problem definition, the algorithm, the error free source code and testing procedures are all part of the documentation package.
29