algorithm is a prescribed set of well defined rules or instructions for the solution of the problem....
TRANSCRIPT
Algorithms and programming
Algorithm is a prescribed set of well defined rules or instructions for the solution of the problem.
Algorithmic language is a language or notation used to express clearly an algorithm.
Algorithm
1) Linear - Линейный
2) Branching - Разветвляющийся
3) Loop (Cycle) - Циклический
Types of algorithm
High level language – A variety of programming language in which the control and data structures reflect the requirements of the problem. It is translated in to machine code by compiler.(Pascal, Delphi, C, C++, etc)
Low level language – A variety of programming language in which the control and data structures directly reflect the underlying machine architecture(Assembler, CIL, etc)
Key words
Flowchart
Begin
Data input
Data output
End
Operations
1. Pour milk in the cup2. Put the cup on the stove3. Light the match 4. Bring the burning match to the stove5. Switch on the stove 6. Wait, until milk boils 7. Switch off the stove
Algorithm of boiling milk
1. Pour milk in the cup2. Switch on the stove 3. Light the match 4. Bring the burning match to the stove5. Put the cup on the stove6. Wait, until milk boils 7. Switch off the stove
Algorithm of boiling milkYou must follow the correct sequence of the algorithm
Program HW; begin writeln (‘Pour milk in the cup’); // shows on the
screen writeln (‘Put the cup on the stove’); writeln (‘Light the match’); writeln (‘Bring the burning match to the
stove’); writeln (‘Switch on the stove’); writeln (‘Wait, until milk boils’); writeln (‘Switch off the stove’); End.
Attempt these codes in Pascal
Program HW;beginwriteln (‘Hello world’); // shows on the screenEnd.
print "Hello, world!“
#include <stdio.h> int main(void) {
printf("Hello, world\n"); //shows on the screen
return 0; }
<?php echo "Hello, world!";
?>
“Hello world” in different programming languages
Hello World message in VBA for Excel
Create simple program, which can display your age in months, weeks, days, hours, minutes, seconds.