Basic Concepts
of Programming

Programming
Languages

Steps in Programming

Algorithm

Flowcharting

Before we begin programming, let
us understand some basic concepts
of programming.

Basic Concepts
of Programming

Programming
Languages

Steps in Programming

Algorithm

Flowcharting

Program
A computer program is an organized list of instructions that, when
executed, causes the computer to behave in a predetermined manner.
Without programs, computers are useless. Therefore, programming
means designing or creating a set of instructions to ask the computer to
carry out certain jobs which normally are very much faster than human
beings can do. (Webopedia)

Programming Concepts

a computer's instruction set is the list of all the basic commands in the computer's machine language. (Webopedia) Programming Concepts . For example. The term instruction is often used to describe the most rudimentary programming commands.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Instruction A basic command.

For example. Systems software : Includes the operating system and all the utilities that enable the computer to function. (Webopedia) Software is often divided into two categories: 1.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Software Computer instructions or data. Programming Concepts . spreadsheets. Applications software : Includes programs that do real work for users. word processors. Other examples of system software are compilers and interpreters. and database management systems fall under the category of applications software. Anything that can be stored electronically is software. 2.

Programming Concepts .Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Applications Software A program or group of programs designed for end users. Systems Software Refers to the operating system and all utility programs that manage computer resources at a low level.

The operating system is also responsible for security.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Operating System The most important program that runs on a computer. Programming Concepts .it makes sure that different programs and users running at the same time do not interfere with each other. ensuring that unauthorized users do not access the system. For large systems. such as recognizing input from the keyboard. keeping track of files and directories on the disk. sending output to the display screen. Operating systems perform basic tasks. It is like a traffic cop -. Every general-purpose computer must have an operating system to run other programs. the operating system has even greater responsibilities and powers. and controlling peripheral devices such as disk drives and printers.

For PCs. but others are available. OS/2. and Windows. the most popular operating systems are DOS. called application programs.Basic Concepts of Programming Programming Languages Steps in Programming Operating System Operating systems provide a software platform on top of which other programs. such as Linux. therefore. The application programs must be written to run on top of a particular operating system. determines to a great extent the applications you can run. Your choice of operating system. Programming Concepts Algorithm Flowcharting . can run.

printers. Operating systems contain a number of utilities for managing disk drives.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Utility Program A program that performs a very specific task. and other devices. usually related to managing system resources. Programming Concepts .

Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Applications Software 1. therefore. If you change one value. Spreadsheet applications (sometimes referred to simply as spreadsheets) are computer programs that let you create and manipulate spreadsheets electronically. and the names of the cells are called labels. Word processor / Word Processing software A program or computer that enables you to perform word processing functions. In a spreadsheet application. Programming Concepts . 2. each value sits in a cell. you may need to change other values as well. Spreadsheet A table of values arranged in rows and columns. You can define what type of data is in each cell and how different cells depend on one another. Each value can have a predefined relationship to the other values. The relationships between cells are called formulas.

Database Management System A collection of programs that enables you to store. and extract information from a database.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Applications Software 3. There are many different types of DBMSs. modify. The following are examples of database applications: • computerized library systems • automated teller machines • flight reservation systems • computerized parts inventory systems Programming Concepts . ranging from small systems that run on personal computers to huge systems that run on mainframes.

The sometimes lengthy process of computer programming is usually referred to as software development. Editing source code involves testing. and refining.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Programming Programming means designing or creating a set of instructions to ask the computer to carry out certain jobs which normally are very much faster than human beings can do. (Webopedia) Programming is the iterative process of writing or editing source code. A person who practices this skill is referred to as a computer programmer or software developer. analyzing. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .

C. you can use a programming language to instruct the computer in a way that is easier to learn and understand. and Pascal. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . A vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. The term programming language usually refers to high-level languages. FORTRAN.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Programming Languages A programming language acts as a translator between you and the computer. such as BASIC. COBOL. Rather than learning the computer's native language (known as machine language). Ada. Each language has a unique set of keywords (words that it understands) and a special syntax for organizing program instructions. C++.

So. the computer has a unique language that converts the data we input into a format that the computer can understand .Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting The Language of Computing As an electronic device. the CPU only understands a combinations of “0” and “1” codes. a language which we called machine language. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . The data we input into the computer turns into electronic pulses which can either be “on” or “off” or “0” and “1” codes in the binary system.

it is cumbersome and hard to understand. it is more directly understood by the computer. however. As such. Low-level languages is a language that is written at the most basic level of computer operation. entirely in binary digits representing instructions and information. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . For programmers. Machine Language is a computer language.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Levels of Programming Languages There are two levels of programming languages: low-level language and high-level language 1. The two low-level languages are machine language and assembly language. used directly by a computer without translation.

An assembly language contains the same instructions as a machine language. (Webopedia) Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . use either a high-level programming language or an assembly language. machine languages are almost impossible for humans to use because they consist entirely of numbers.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Machine Language The lowest-level programming language (except for computers that utilize programmable microcode) Machine languages are the only languages understood by computers. but the instructions and variables have names instead of being just numbers. Programmers. therefore. While easily understood by computers.

Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Machine Language Machine language is extremely difficult to learn and it is not for us laymen to master it easily. we have many smart programmers who wrote interpreters and compilers that can translate human language-like programs such as BASIC into machine language so that the computer can carry out the instructions entered by the users. Fortunately . Machine language is known as the primitive language while Interpreters and compilers like Visual Basic are called high-level language. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .

Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Compiler A program that translates source code into object code. The advantage of interpreters is that they can execute a program immediately. without looking at the entire program. Compilers require some time before an executable program emerges. The compiler derives its name from the way it works. However. Thus. (Webopedia) Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . programs produced by compilers run much faster than the same programs executed by an interpreter. a compiler differs from an interpreter. looking at the entire piece of source code and collecting and reorganizing the instructions. which analyzes and executes each line of source code in succession.

The interpreter. can immediately execute high-level programs. is that it does not need to go through the compilation stage during which machine instructions are generated.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Interpreter A command interpreter is the part of a computer operating system that understands and executes commands that are entered interactively by a human being. a compiler translates high-level instructions directly into machine language. For this reason. In contrast. In addition. This process can be time-consuming if the program is long. however. on the other hand. Compiled programs generally run faster than interpreted programs. An interpreter translates high-level instructions into an intermediate form. interpreters are sometimes used during the development of a program. which it then executes. interpreters are often used in education because they allow students to program interactively. The advantage of an interpreter. when a programmer wants to add small sections at a time and test them quickly. (Webopedia) Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .

Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Programs written in high-level languages are translated into assembly language or machine language by a compiler. Assembly language programs are translated into machine language by a program called an assembler. Every CPU has its own unique machine language. therefore. Programs must be rewritten or recompiled. to run on different types of computers.

all programs were written in assembly language. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . (Webopedia) Each type of CPU has its own machine language and assembly language. so an assembly language program written for one type of CPU won't run on another. most programs are written in a high-level language. In the early days of programming.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Assembly Language A programming language that is once removed from a computer's machine language. Machine languages consist entirely of numbers and are almost impossible for humans to read and write. Now. Programmers still use assembly language when speed is essential or when they need to perform an operation that isn't possible in a high-level language. Assembly languages have the same structure and set of commands as machine languages. but they enable a programmer to use names instead of numbers.

These “set-up” languages are called high-level languages. Simple instructions. still required too many steps. however. Written in an English-like manner and using many English words. these languages offer convenience and simplicity for programmers. programmers saw that writing programs was still too complicated. In 1950s.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting High-level languages Even with assembly language. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . programmers began to develop languages that could relieve them from the burdensome details of writing programs in low-level languages. like finding the sum of 2 numbers.

programs written in a high-level language must be translated into machine language by a compiler or interpreter. or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages. FORTRAN. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . write. assembly languages are considered low-level because they are very close to machine languages.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting High-level languages A programming language such as C. The main advantage of high-level languages over low-level languages is that they are easier to read. In contrast. Ultimately. and maintain.

but they are much easier to program in because they allow a programmer to substitute names for numbers. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . Lying above high-level languages are languages called fourth-generation languages (usually abbreviated 4GL).Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Lying between machine languages and high-level languages are languages called assembly languages. The other four generations of computer languages are : • First generation: machine language • Second generation: assembly language • Third generation: high-level programming languages. Machine languages consist of numbers only. Assembly languages are similar to machine languages. and Java. 4GLs are far removed from machine languages and represent the class of computer languages closest to human languages. • Fifth generation: languages used for artificial intelligence and neural networks. such as C. C++.

It is still widely used today in the engineering fields. Cobol. It was designed for commercial applications that required large amount of data processing. 2. COBOL stands for Common Business Oriented Language which was created by a group of computer manufacturers and industrial computer users in 1959.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting High-level Programming Languages Some of the high level computer languages beside Visual Basic are Fortran. Turbo Pascal. Java. FORTRAN stands for FORmula TRANslator and it was developed by IBM Inc. C++. between 1954 and 1957 which was used specifically for scientific ad engineering applications. It is still being used today in the business fields. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . 1. and etc.

1999) . It was actually an extension of C++ but it has included extensive libraries for doing multimedia. graphics. JAVA is the latest but one of the hottest programming languages developed by the Sun Microsystems in 1995. GUI programming. Microsoft also come out with its own version of Javawhich is known as Visual J++. Its use is primarily confined to the academic world. 6. database access. C++ is an extension of C which was created by Bjarne Stroustrup in 1980's. It added the OOP (Object-Oriented Programming) feature to C and now it is the main systems implementation language (Deitel&Deitel. 5. multithreading . 4. Programming Languages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 . PASCAL was created by Professor Nicklaus Wirth for teaching the concepts of structured programming.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting High-level Programming Languages 3. networking. It is a system implementation language that was used to develop the UNIX operating system. C was developed by Dennis Richie at Bell Laboratories in 1972.

Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Steps in Programming The five steps in the programming process are: 1. Insure that the program works as planned (Use an Interpreter or Compiler . Test and Debug the Program – translate and debug.Run or Execute the Commands which translate source code into object code) Steps in Programming . processing. Define the Problem – discuss problem with the users of a system and the systems analyst to determine the necessary input. Write the Program – express the solution in a programming language 4. Design the Solution – design an algorithm and represent the logic using a Flowcharts or Pseudocode 3. 2. and output .

and identifies syntax errors . Listings of your source code is a type of documentation. Steps in Programming . so are comments within the source code as well as user manuals.translates line by line from source code (actual programming language) into object code.translates entire program of source code (actual programming language) into object code. development. 5. Document Throughout – provide material that supports the design. and testing of the program. and identifies syntax errors (violations in using programming language instructions) compiler .Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting Steps in Programming interpreter .

A computer program can be viewed as an elaborate algorithm.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting ALGORITHM An algorithm is a procedure for solving a problem. it is a series of steps that should be followed exactly to produce a desired result. who was part of the royal court in Baghdad and who lived from about 780 to 850. In mathematics and computer science. Mohammed ibnMusa al-Khwarizmi. Al-Khwarizmi's work is the likely source for the word algebra as well. an algorithm usually means a small procedure that solves a recurrent problem An algorithm (pronounced AL-go-rith-um) is a procedure or formula for solving a problem. Algorithm . more specifically. The word derives from the name of the mathematician.

Structured programming (sometimes known as modular programming) is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. • techniques that impose a logical structure on the writing of a program. modular routines. • is a computer programming in which the statements are organized in a specific manner to minimize error or misinterpretation. following a universal programming standard. or modules.Basic Concepts of Programming Programming Languages Steps in Programming Algorithm Flowcharting STRUCTURED PROGRAMMING • is a technique that emphasizes the breaking of a program – or algorithm – into logical sections. Large routines are broken down into smaller. Structured Programming .

structured programming employs what is called Algorithm Flowcharting There are three basic control structures we must be familiar with: sequence. or series of steps.a step. “control structures” .Basic Concepts of Programming Programming Languages Steps in Programming CONTROL STRUCTURES To control the flow of our algorithm or programs. Control Structures . selection and iteration. that determines what instruction or set of instructions will be done next.

In this case.Basic Concepts of Programming Programming Languages start Steps in Programming Algorithm Sequence Control Structure ( No Branching) Process 1 Process 2 Process 3 The sequence control structure is the most straightforward of all the control structures. end Sequence Control Structure Flowcharting . your algorithm or program will just follow instructions or statements one after the other in sequence.

and depending on the answer. after which the program moves on to the next event. This structure is sometimes referred to as an ifthen-else because it directs the program to perform in this way: If Condition A is True then perform Action X else perform Action Y. Also called decision control structure. Selection Control Structure . the program takes one of two courses of action.Basic Concepts of Programming Programming Languages Steps in Programming IF (condition) Process (Branching Forwards) no Process start Flowcharting Selection Control Structure start yes Algorithm In a selection structure. a question is asked.

which means that it repeatedly executes the loop IF (condition) yes Process no end In a loop structure. Each pass through the loop is called an iteration. The computer iterates through the loop.Basic Concepts of Programming start Programming Languages Steps in Programming Algorithm Flowcharting Iteration / Loop Control Structure (Branching Backwards) A single pass through a group of instructions. Iteration / Loop Control Structure . the program asks a question. it is performed and the original question is asked again until the answer is such that the action is no longer required. Most programs contain loops of instructions that are executed over and over again. and if the answer requires an action.