Information Sheet No 1.1
Information Sheet No 1.1
Information Sheet No 1.1
Learning Outcomes:
INTRODUCTION TO PROGRAMMING
Nowadays, computers have become irreplaceable. We use them to solve complex problems at the
workplace, have fun and communicate. Despite the fact that computers are so widespread, computers still rely
on human beings who will feed set of instructions to carry out a task. These instructions are called program, and the
person who write the program are called programmer.
How do computers understand the instruction given to it by the programmer? Because the computer is
powered by electricity, it can only understand an on or off switches as represented by 1 or 0. Programmers had to
write program instruction using a series of 1’s or 0’s called machine language or low-level language. As computer
technology evolves, the assembly language was developed which simplifies the very tedious task of writing a series
of 1’s or 0’s through alphabetic abbreviations called mnemonic code. Programs written in assembly language
require an assembler (other program) to convert the assembly code to machine code.
The rapid growth of computer hardware technology affects many programmers to develop another
programming language allowing them to use instruction that more closely resemble the English language called
high-level language. This language requires either an interpreter or a compiler to convert the English-like
instructions into machine language. There are many programming languages available in the market today. These
include C Sharp (contained on this manual), C, C++ COBOL, VB, VB.Net, etc. Compiler and interpreter is needed
to translate the instructions from high-level language to low-level language
Logic formulation and problem-solving skills are the fundamentals of programming. It requires intricate
process of critical and analytical thinking with precision and intensity to details. With this, planning is very
important because it serves as the backbone of any program.
Algorithm is a finite set of instructions for carrying out some process step by step. This is the process
where the problem breaks down into simple steps so that the right answer may yield. A recipe in a cookbook is an
example of an algorithm. The complicated preparation of a dish is broken down into simple steps that even an
inexperience person in cooking can understand.
Pseudo code is an algorithm in English statements. It conveys the instructions before coding it using a
programming language such as C Sharp. The series of step-by-step instruction is outlined in an English word and
translate it to a language understandable by the computer.
Historically, man has always tried looking for ways to simplify work and to solve problems more
efficiently. Such problems may involve numbers and quantities, which resulted to the better ways of counting using
mathematical operation. Regardless of the problem a man encounters, solving a problems involves the following;
The computer is basically a problem-solving tool provided with a valid set of instructions by the
programmer becoming the computer a self-operational, that is, human intervention is not needed during the process
anymore. The five steps below should generally perform in sequence so as to attain an effective problem-solving
tool.
1. Define what has to be done or what problem has to be solved. The basic to planning a solution.
2. Planning a solution to the problem – Selecting the best method for solving a problem. It commonly
involves determining sequence of steps in solving a problem using pictorial representation.
3. Coding the solution – translating the series of steps into a code understandable by the computer to execute
4. Checking out the program by debugging and testing – Checking for any possible errors like logical and
syntax.
Example 1:
The radius of a circle is equal to three unit. Device an algorithm that will compute and display the area of the circle.
Algorithm steps:
Example 2:
Compute the average quiz grade obtained by the students in his 3 quizzes. If the average is greater than or equal to
75, the remarks “passed” will be printed. Otherwise, if it is below 75, the remarks “failed” will display instead.
Algorithm steps:
Example 3:
Enter an age. If the age is less than 18, display the message “ you can not vote”. The program will only stop if the
age entered is 18 above.
Algorithm steps:
References
Svetlin Nakov, Vaselin Kolev & Co. (2013) Fundamentals of Computer Programming with C Sharp
http://www.introprogramming.info