Monday, October 14, 2019

Lesson 2 : Programming Skills

Any one could learn programming and become a skilled programmer, a person with programming skills are good at three aspects of this skill.

3 Pre-requisite to become a Skilled Programmer
  1. Problem Solving Skills
  2. Algorithmic Notation
  3. Programming Language
Problem Solving Skills

Programming does not require a deep or massive knowledge of mathematics but it is a plus for aspiring programmers. A problem solving skill is a type of skill which make a person able to develop a solution to given problem either mathematical or logical problems, numbered equations or intellectual scenarios and decision making.

Algorithmic Notation
  • Algorithm is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.
  • An Algorithmic Notation is a set of functions, rules or process use to perform task to solve computing problems.
Algorithmic Notation can be presented into three parts:
  1. Problem Analysis using Input -> Process -> Output (IPO) model
  2. Flow Chart (with Simulation)
  3. Pseudo code
Problem Analysis

Using IPO model to analyze a problem. I represents the Given, P represents the Action to be taken and O represents the Outcome or Result.

Example

Problem:
Mario is ask to identify the minimum and maximum number from two given numbers 5 and 3.

Analysis:
I = Numbers 5 and 3
P = Compare two given numbers
O = Minimum and Maximum

Flowchart


Graphical representation of steps, it shows steps in a sequential order, and is widely used in presenting flow of algorithms, workflow or processes. Flowchart similarly looks like an Activity Diagram of UML but the main difference is that Activity Diagram behavior diagram that represents the workflow of stepwise activities of the system while a flowchart is a graphical diagram that represents the sequence of steps to solve a problem.

Symbols used in Flow Chart




Pseudo code

Pseudo code Is a notation resembling a simplified programming language, used in program design and very similar to a natural language or English language with a mixture of mathematical equations and symbols sometimes. Learning to write a good Pseudo code is closer to be able to write program codes in different programming languages

Example: In this example we will still use the previous problem and Flowchart

Step 1: Declare four integer variable

Say…
int A, int B, int Min, int Max

Step 2: Initialize A and B with numbers supplied by the user
Let A = ?
Let B = ?

Step 3: Compare the value A to B
Say…
If the value of A is greater than the value of B then
Assign the value of B to variable Min
Assign the value of A to variable Max
Else
Assign the value of A to variable Min
Assign the value of B to variable Max
End if
Step 4: Display output
Print Min and Max

Or we could do it this way…

Declare four integer variable A, B, Min and Max
Initialize variable A and B with user input
If the value of A is greater than the value of B then
Assign the value of B to variable Min
Assign the value of A to variable Max
Else
Assign the value of A to variable Min
Assign the value of B to variable Max
End if
Print Min and Max

Programming Languages

= A programming language is a vocabulary and set of grammatical rules equivalent to human language used for instructing a computer or computing device to perform specific tasks.
= A series of codes of instructions to control the operation of a computer or other machine.

Two Levels of Programming Languages

1. Low Level Programming Languages


This level of programming languages are closed to machine language or raw in nature and harder to read than high level programming languages.

Example: Assembly x86

SUB AX,AX
MOV ES,AX
SUB BH,BH
MOV BL,INT_NUMBER
SHL BX,1
SHL BX,1
MOV DI,ES:[BX]
MOV ES,ES:[BX+2]
ADD DI,4
LEA SI,TAG
MOV CX,TAG_LEN
2. High Level Programming Languages

This level of programming languages is much closer to human or natural language, usually English language and more readable than low level programming language examples are C, Java, Basic, Cobol, Fortran, Ruby, Python.

Example: Java

public class Welcome{
     public static void main(String[] args){
          System.out.println("HELLO WORLD!");
     }
}

When learning programming language, it is a prerequisite to learn what the important parts of a programming language are.
  1. Syntax
  2. Semantics
Syntax and Semantics are significant terms relating to any programming language. Syntax involves the set of permitted phrases of a language while semantics expresses the associated meaning of those phrases. In other words when relating to a natural language, Syntax is the grammar of a programming language while the semantic is the meaning or thought of the code or the syntax.

Learning how to program requires only to master one programming language as a beginner, then this will make anyone able to write codes using other programming language, you only need to understand the semantic one time for it is always applicable to different programming language but you need to learn different syntax to master different programming languages. It is like translating a Tagalog language to English terms.

Example:

Natural Language
Tgagalog : Ako ay Pilipino
English : I am a Filipino

Programming Language 

Java Programming Language JAVA 

If(A>B){
     Min = B;
     Max = A;
}Else{
     Min = A;
     Max = B;
}

Java Programming Language VB.net

If A>B then
     Min = B;
     Max = A;
Else
     Min = A;
     Max = B;
End if

No comments:

Post a Comment

A REVIEW ON CONNIE DABATE’S MURDER CASE: Fitbit One Wearable

T he Author   ROSITO D. ORQUESTA MSIT Student at Jose Rizal Memorial State University-Dapitan Campus OIC-ICT Dean, Eastern Mindanao College ...