Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

[SHARE] Programming Methods + Data Types & Arithmetic Operators

CodingSource

The Loyalist
Advanced Member
Messages
514
Reaction score
0
Points
26
Paalala lang po na ito ay isang brief explanation lang. Kapag ginawa kong detailed itong mga explanation na ito ma-eexceed ko na po ang limit kasi kapag ako ang mag-explain gusto ko mayroong code na example eh. Pero this thread, I believe, will be perfect for beginners especially to experienced programmers kahit anong programming language ang gamit.


PROGRAMMING METHOD
Dapat meron tayong sinusundan na pattern sa pagdedevelop ng program. Kahit na ang mga pinakamagagaling na programmer sa mundo alam ko hindi sinusundan ng mabuti ang pattern na ito. Ito ang pinakabasic na kailangan niyong malaman sa pagdedevelop ng program.

Ito ang mga guidelines na susundin natin para magawa natin ang program na hindi tayo naguguluhan:
1. Analyze the problem
2. Design the program
3. Code the program
4. Test the program


ANALYZE THE PROBLEM
Ang ibang mga programmer hindi inuuna ang pag-analyze. Ginagawa laang nila ito pagkatapos ng "Design the Program", which is a bad practice.

So ang pag-analyze ay hindi na dapat in-eexplain yan. Gawa tayo ng example:

- Ang problema: Gusto ni Pedro na mag-invest ng pera sa isang bangko. Maraming opsyon tulad ng interest rates, terms of deposit, at compounding frequencies. Kailangan niya ng programs para i-compute ang investment.

Ano-ano ang mga input? (given data)
Ano ang mga output? (required data)

Paano natin ma-cacalculate ang required outputs mula sa given inputs?


DESIGN THE PROGRAM
Sa pagdedesgin ng program, kailangan mo munang i-outline ang design niya (Graphic User Interface).

Tapos dapat may algorithm, o yung step-by-step procedure na makakapagbigay ng mga kinakailangan na resulta mula sa mga inilahad na mga input. Ang isang halimbawa ng algorithm ay ang mga instruction kung paano gumawa ng cake, kung paano gumamit ng ATM, etc.

CODE THE PROGRAM
Kapag tapos ka na sa design, syempre, common sense, i-code mo na. Para makapag-code ka, dapat may gamit kang programming language. Ang mga halimbawa ng mga programming language ay Visual Basic, C++, Java, at marami pang iba. Ang magandang gawin muna bago mag-attempt ng pag-type ng code ay ang "pseudocode". Literally, ang ibig sabihin nun ay "false code".

Ito ang halimbawa ng pseudocode:
Code:
If the Text of TextBox1 is equal to the Text of TextBox2, then the button should be enabled.

Kapag i-coconvert natin yan sa VB.NET:
Code:
 IF TextBox1.Text = TextBox2.Text Then
  Button1.Enabled = True
EndIf

Mahalaga ito sa pag-dedevelop ng mga skills na kakailanganin mo habang nag-aaral ka ng programming language.

TESTING THE PROGRAM
Marami sa mga IDE na ginagamit ng mga programmer ngayon ay ipinapakita kung saan sila nagka-error. Merong guide din ang mga programmer sa IDE na ang tawag ay "Intellisense" kung saan habang nag-tytype ka, merong ipapakita sa iyong listahan kung ano ang mga code that matches the characters na na-itype mo. Ngayon, kung ang IDE mo walang ganitong feature, then syempre, common sense uli, hanapin mo muna ang mga error kundi magkaka-bug ito. Dapat mong isaisip na ang pagtetest ay natatapos "throughout the development cycle".

Merong technique na tawag ay Desk-checking, o ang code walkthrough na pineperform mo para mahanap ang mga error sa code mo. Just pretend na ikaw ang computer at in-eexecute mo ang iyong code.

Ang pang-huli sa lahat, debug your code para makita mo kung ang mga output ay tama para sa problema.

----------------------

TYPES OF DATA
Halos lahat (o lahat) ng mga programming language ay may mga data types na ganito:

Numeric Data:
- Integer Data: Whole numbers (10, 25, -45, 0)
- Floating point data: mayroong decimal point (23.0, -5.1)

Character Data (Alphanumeric):
- All the characters that you can type at the keyboard.
- Letters & numbers not used in calculations

Boolean data:
- Ang value ng data na ito ay TRUE o FALSE lamang.

----------------------

ARITHMETIC OPERATORS
Exponentiation
Symbol: ^
Example: 4^2
Result: 16

Multiplication
Symbol: *
Example: 16*2
Result: 32

Division
Symbol: /
Example: 16/4
Result: 4

Addition
Symbol: +
Example: 16+16
Result: 32

Subtraction
Symbol: -
Example: 16-16
Result: 0
 
Back
Top Bottom