0% found this document useful (0 votes)
5 views6 pages

1.ICP - Introduction.docx

Introduction to Programming

Uploaded by

Leo Nembaware
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

1.ICP - Introduction.docx

Introduction to Programming

Uploaded by

Leo Nembaware
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Introduction to computer programming

●​ Computer programming is writing computer code to create


a program, to solve a problem.
●​ A program is a collection of instructions that can be executed
by a computer to perform a specific task.
●​ Programs are made up of statements that the programming
language knows and understand.
●​ Programs are created to implement algorithms (set of steps
for carrying a specific task)
●​ It is written/created by a programmer using a programming
language.
●​ A programming language is an artificial language that a
computer understands.
●​ The programming language is made up of series of
statements that fit together to form instructions. These
instructions tell a computer what to do.
●​ The types of programming languages comprises of object
oriented programming languages and non-object oriented
programming languages.
●​ Object oriented programming languages - A type of
programming where data types representing data structures
are defined by the programmer as well as their properties
and the things that can be done with them examples include
Simula, Java, C++, C#, and Python.
●​ Non object / procedure oriented programming
languages - A type of programming where a structured
method of creating programs is used examples include C ,
COBOL and FORTRAN.

1
Computer Programming Concepts

Algorithm​

●​ A set of steps for carrying out a specific task.


●​ They are used extensively in computer programming to
arrive at a solution for a problem.
●​ The process of creating an algorithm involves
documenting all the necessary steps needed to arrive at
the solution and how to perform each step. A real world
example of an algorithm would be a recipe. The
instructions of a typical recipe (add ingredients, mix, stir,
etc.) are an algorithm.

Source code​

●​ The actual text used to write the instructions for a


computer program. This text is then translated into object
code which a computer can understand.

Compiler

●​ This is a software tool that translates source code into


data that the computer can understand.
●​ Specifically, a compiler is used to turn source code into
object code.
●​ The object code is then passed through a program called
a linker which turns it into an executable program.

Data type

2
●​ This is the classification of pieces of information in a
program.
●​ The amount of different data types varies between
languages. Typically, there are data types for integers
(whole numbers), floating-point numbers (numbers with a
decimal part), and single characters. To distinguish
between different data types, a computer uses special
internal codes.

Variable

●​ A container which represents a value in a program.


●​ Variables can store different types of data including
numeric values, single characters, and text strings.
●​ The value of a variable can change all throughout a
program.

Constant

●​ The same thing as a variable with one major difference -


the value of a constant does not change, while the value
of a variable can change all throughout a program.

Conditional

●​ A set of code that will execute only if a certain condition is


true.
●​ Conditionals are used to test expressions and perform
certain operations accordingly. For example, you could

3
test a number input by the user and if it is too high print
the message "The number entered is too high" and the
program exits.

Array​

●​ A special type of variable that is used in many


programming and web languages including PHP, Java
script, and Java that contains a list of related values. For
example, a colors array would contain a list of colors such
as red,green,blue, green, brown e.t.c

Loop
●​ A segment of code that executes repeatedly based on a
certain condition.
●​ Loops are used to perform tasks repeatedly a certain
amount of times. For example, if you needed to print the
numbers 1 to 10. You can use a loop for this task instead
of manually printing all the numbers.

Function

●​ A set of code used to carry out specific tasks. A function


can take parameters which will affect its output as well as
return values.

●​ Functions prevent unnecessary redundancy because you


can use them as much as needed instead of retyping
some code over and over. For example, if you need to
multiply two numbers, instead of doing the calculation
manually every time, you can supply the data to a function
through some parameters which will do it for you.

4
Class

●​ A template for a real world object to be used in a program.


For example, a programmer can create a car class which
represents a car. This class can contain the properties of
a car (color, model, year, etc.) and functions that specify
what the car does (drive, reverse, stop, etc.). Classes are
used in object-oriented programming.

5
References
Landofcode.com. 2022. Computer programming concepts.
[online] Available at:
<http://www.landofcode.com/programming-intro/computer-progra
mming-concepts.php> [Accessed 7 July 2022].

You might also like