Computer Programming Concepts

in #science7 years ago (edited)

Definition Of Algorithm


  • Algorithm is a sequence of logical steps of problem solving that are arranged systematically.
  • The word logical here means true according to human logic.
  • To be an algorithm, the sequence of steps taken to solve the problem must give the correct result.

Algorithm Writing


  1. In natural language (Indonesian, English, and other human languages)
    • But often ambiguous
  2. Using a flow chart (flow chart)
    • Good visually but bother if algorithm is long
  3. Using pseudo-code
    • It is closer to the programming language, but it is difficult to understand by people who do not understand programming

Algorithm In Natural Language


  • Take the first number and set maks equal to the first number
  • Take the second number and compare it to the maks
  • What if the second number is greater than the maks, the set maks equals the second number
  • Take the third number and compare it to the maks
  • If the third number is greater than the max, the set maks equals the third number
  • The maks variable contains the largest number. Show the results

Example algorithm 1


  1. There are 2 glasses. One contains tea and the other contains coffee. How do I change the contents of each glass?
    Screenshot_1.png

The Answer

Picture1.png

  • Prepare backup glass X
  • Pour glass of tea into glass X
  • Pour a glass of coffee into a tea cup
  • Pour a glass of X that contains tea into a coffee cup


IF YOU LIKE MY POST
FOLLOW ME AND UPVOTE
@auliaramadhn

myAvatar.png
MOTIVATION
You can not always talk, can not always move to help people. But the writing you write will forever be able to be used by people.

THANKS YOU

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 58333.83
ETH 2280.23
USDT 1.00
SBD 2.50