Sunday, October 9, 2016

Programming and Algorithm

Programming and Algorithm




Today I want share an articel about programming and algorithm, ecxactly used for newbie.

Learning outcomes :
In the end of this article, I hope reader can explain about basic consepprogramming, algorithm, and structured programming.

What is algorithm.
Algorithm islimited steps to solve any problem. In programming, algorithm is defined as a method that contains structured steps to solve any problem with computers help.

Programming and Algorithm | Sofi Rahmatulloh
Programming
Programming and Algorithm | Sofi Rahmatulloh
Algorithm
Good program always contains idea, solve, and solution.

Define the problem :
Problem : calculate the volume of cube ?
Define : volume = side * side * side;
Data will needed : side, type : real.

Make type to solve :
Type to solve : volume = side * side * side;

Build algorithm :

Programming and Algorithm | Sofi Rahmatulloh


write the program :
#include <iostream>
#include <conio.h>
using namespace std;

main ()
    {
        float side, volume;
       
        cout<<"Input side : ";
        cin>>side;
           
        volume = side * side * side;
       
        cout<<"Volume is : "<<volume<<endl;
        getch();
    }


Then compile the program.

Programming and Algorithm | Sofi Rahmatulloh



Syntax error :

Programming and Algorithm | Sofi Rahmatulloh





If syntax error, you must correct it.
Then execute :
Programming and Algorithm | Sofi Rahmatulloh


Then, if there no error, make a documentation.
Documentation contains :
  1. Define the problem.
  2. Calculate model/Math
  3. Flowcart/design of algorithm
  4. Source code.
Okay its all about programing and algorithm.



Available link for download