Saturday, 7 March 2015

Some Basics


Today, most people don't need to know how a computer works.  Most people can simply turn on a computer or a mobile phone and point at some little graphical object on the display, click a button or swipe a finger or two, and the computer does something. How to interact with a computer program is all the average person needs to know.
But, since we are going to learn how to write computer programs, we need to know a little bit about how a computer works.  Our job will be to instruct the computer to do things and you know what this is called ‘programming’.
An important reason to consider learning about how to program a computer is that the concepts underlying this will be valuable to you, regardless of whether or not you go on to make a career out of it.  One thing that you will learn quickly is that a computer is very dumb, but obedient. 
Let’s take a look at some of the common terms we’ll be encountering;


    Process:
    A series of actions or steps taken to achieve an end.

    Procedure:
    A series of actions conducted in a certain order.

    Algorithm:
    An ordered set of steps to solve a problem.

    Flowchart:
    An ordered set of steps in a pictorial/symbolic form to solve a problem.
                                             
Basically, writing computer programs involves describing processesprocedures; it involves the authoring of algorithms.

Program/Programming Language
Programming is teaching and instructing the computer to perform a certain task for a desired output.
                                                             Or
Simply saying, getting things done by a computer.
But, the question is how do we do that?
That’s what we are really going to learn.
Remember, to have a possible communication between two parties, some common language or terminology is required.  These are the set of instructions that are understood by both the parties, required for communication is called program and the language used to deliver these instructions is called programming language.


Basic steps involved in programming
Step 1: Design the idea     (What we want to do)
Step 2: Specifications        (Requirements/How to do)
Step 3: Algorithm
Step 4: Flow chart
Step 5: Implementation




 Algorithm
GK*: The term ‘Algorithm’ was coined by Al-Khowzmi.
It is a step by step computational procedure to convert the input data into output (by solving a problem).
Simply speaking, Algorithm is the English representation of the programming language we feed into the computer.
To understand, take a look at this example,
A mother instructs a ‘dumb’ child to purchase a loaf of bread. She would explain somewhat like this;
Step 1: Go to the baker.
Step 2: Give him a hundred rupees.
Step 3: Take a loaf of bread.
Step 4: Take back the change.
Step 5: Come back home with the loaf of bread and the change money.
Now, have you realised something.
Yes; isn’t it an ordered set of steps and it has been used to solve a problem or perform a task!
This is an algorithm and that is why sometimes it is also known as ‘Pseudo code’.

Characteristics of Algorithm

           1.  Each instruction must be precise and unambiguous. 
           2.  Must complete in a finite interval of time.
           3.  No repetitions of instructions.
            4. After execution, desired output shall come.


Flow Chart

Simply speaking, flow chart is the pictorial presentation of an algorithm or procedure in a sequence or order (as you say) ultimately solving a problem.
The picture above is a type of flow chart; since it is a pictorial presentation representing an algorithm, it is in a sequence and ultimately it’s likely to give an output.
Let’s take another example;

                                                              Other flowchart symbols include decision box which is diamond in shape.
Note: The lines used to connect two symbols together are called flow lines.
Start/ Stop box is generally known as terminal box.

                                                                                                                                

EK4U**: 1 GB (Gigabyte) is equivalent to 1024 MB (Megabyte)
1 MB is equivalent to 1024 KB (Kilobyte)
1 KB is further made up of 1024 bytes
Coming down to the lowest level;
1 byte is equivalent to 8 bits.

GK: Computers can store all kinds of information in the form of binary digits, i.e. in the form of 1s and 0s. For instance, 8 is equivalent to the binary number of 1000.

GK: Get to Know
EK4U: Extra Knowledge for You.

I'd better say you better remember these acronyms; we'll be using it more often over the course of time.


Muhammad Zeeshan

About Muhammad Zeeshan

I am a Engineering student. Likes to code and design and sharing with all.

Subscribe to this Blog via Email :