Saturday, February 7, 2009

Learning C++ As A First Programming Languange

Thursday, February 5, 2009

Programming logic for beginner

Most of the IT students, or beginners who decided to learn a programming, alway taking a wrong step by skip the logic and concept, straightly go into the programming language. And it end up to be "programming is hard to learn"! here are the simple few concepts to kick-start your learning:

Kick-start session1
WHAT IS THE OBJECT-ORIENDTED PROGRAMMING?


Alot people might dont know how to explain this. this is the first thing you have to understand before you learn any programming languanges.

Object-oriented programming is mean programming based on the real world object. Objects can be anything, a living objects or non-living objects, let take a simple example,

example Object: television





here our object is TV, every object got attributes and behaviours, example show on diagram.

if we take human as a object, human will have attributes like height, eyes color, skin color etc and behaviours like talking, working eating etc.



so above example is easy to understand what is a object, now we change those components from a object to a programming component:

1. Object --------------------> Class

2. attributes---------------->variables

3. behaviours--------------->function

now that is those words you alway seen in programming, class, variables, and function.




Kick-start session2
UNDERSTAND THE CONSTANT VALUE AND VARIABLE IN PROGRAMMING




CONSTANT VALUES:

In all type of programming language, we need constant value to do processing like calculation, displaying, input etc.

constant value can seperate in 2 type - alphanumeric and numeric data.

alphanumeric constants

- comprise A-Z, a-z,0-9. symbols like http://www.blogger.com/. each letter, symbol or number is called character, example aplhabet A. aplhanumberic character are enclosed within single quotes like example 'a', '1' etc.

number constants

-comprise 2 type integer and float

integer - whole number: example 3, 100, 45, 99.

float - decimals number: example 2.6,78.99 12.334.

important:

program run in computer was processing line by line, it mean program codes will be read a line->process->enter new line and read->process.

constant values couldn't be bring from line to another line. so we need to store into a variable and carry to new line.

VARIABLE:

- variable used to carry a constant values in programming.

-each variable used in program must be declare a type, like integer variable, character variable before it can carry a data. usually in most type of programming, variable will be declare as

{data type} {name of variable} eg: integer number

-----user-friendly translation for the logic of constant values and variable----

example:

let said we are selling fruits, different kind of fruits, orange, apple, watermelon etc. we need to carry those fruits from farm to stores for sales. question is, will you carry them one by one? a apple by apple each time?? so we need a boxes to fill in those fruits and put in a trucks to send to our stores.

fruits ------> constant values

boxes------> variable

so the concept is easy to understand.