Midterm 1 Flashcards
Computer Programming Discipline
Is a part of informatics (computer science) which studies methods and techniques for developing, analyzing and applying algorithms and programs that can be used for solving different problems by means of computers.
Algorithm
Is a set of operations (actions) and order of there execution (step by step procedure) for solving a given problem.
Forms of algorithm representation (description)
1) natural form - by using human and other languages:
2) graphical form – by using flowchart (a diagram consists of special symbols of operations linked between them);
3) a pseudo-code – by using special rules for operations
description and a computer program – by using programming languages.
Graphical symbols of operations: Starting operation
{ - opening brace, (start)
Graphical symbols of operations: Ending operation
return statement;
} - closing brace
(stop)
Graphical symbols of operations: Input operation
scanf( );
/__/
Graphical symbols of operations: Output operation
printf( );
|~|
Graphical symbols of operations: Calculation operation or
Assignment operation
assignment statement: variable = expression;
|__|
Graphical symbols of operations: Decision (conditional)
operation
if(condition){statements Yes;}
else {statements No;}
<>
Graphical symbols of operations: Precondition loop operation
for(ex.1; ex.2; ex.3)
{statements of loop body;}
<_>
</_>
Graphical symbols of operations: Subprogram call operation
subprogram call statement;
||__||
Parts of any program written in C language:
a) preprocessor directives;
b) one or more texts of functions (subprograms);
c) declarations situated out of the function bodies;
Structure of a function in C language:
a) header line of the function;
b) body of the function which is situated between opening and closing braces.
format specifier integer
%d
format specifier float
%f