Milandeep Bassi

Understanding 6 Basic Programming Concepts

11th, January, 2020


Pseudo Code

The first concept to understand is pseudo code. So, this basically means writing a program as instructions. Let’s say we wanted to check if an number is positive or negative.

Start
Get number
If number more than zero
Print positive
If number is less than zero
Print negative
If number is 0
Print zero
End

That is it! That’s going to be the outline for our program and it’s nice and easy to understand. That’s basically what Pseudo code is.


Control Flow

control-flow

A sequence is a list of action that will always be performed one after another.

Control flow basically will determine the sequence in which code is executed. This includes the statements, instructions or even calls of an application.


Selection

iteration

A selection involves making a test, and then performing one of a set of actions depending on the result. The other actions are ignored.

This is one of the basic structures used in computer programming. This is the logic when a program has to make a decision based on a question that is being asked. After which the program will move onto executing a statement if the question is true or proceed to the successor if the statement is false.


Iteration

iteration 1iteration 2

An iteration repeats an action as long as a test is passed. Sometimes we do the action first, and then test whether to repat. The alternative is to do the test first and if it passes do the action.

This is another basic structure used in coding globally. These are also referred to as loops. In a loop a question will be asked and if the answer is true the statement will be executed until the question is false. Once a loop is broken the code will move onto the successor.


Calls

calls

A call tells us to stop what we're doing, go perform some other sub-program and then come back and carry on where we left off.

A call is a way of accessing code that may be stored elsewhere or from another file. This is used to create more efficient code sometimes as a task that may be repeated multiple times in a project will be using a call rather than using the same code, copy and pasted.


Variables

Variables are the labels for data essentially. The data is then stored to this label. If you wanted a program to remember someone’s name then when asking for the input you assign a variable to it. 

<variable name> = <data>

The syntax above is how you assign a variable to some data. The first time you assign data to a variable this is called declaration. Some examples variables are below.