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

Introduction Notes

Uploaded by

raphaelmumo92
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 views9 pages

Introduction Notes

Uploaded by

raphaelmumo92
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/ 9

TOPIC 1 : INTRODUCTION TO PROGRAMMING AND ALGORITHMS

– a technique for organizing and coding computer programs in which a


Structured programming
hierarchy of modules are used, each having a single entry and a single exit point, and in which
control is passed downward through the structure without unconditional branches to higher levels
of the structure.

Computer hardware - refers to the physical parts of a computer and related devices. Internal
hardware devices include motherboards, hard drives, and RAM. External hardware devices include
monitors, keyboards, mice, printers, and scanners.
The internal hardware parts of a computer are often referred to as components, while external
hardware devices are usually called peripherals. Together, they all fall under the category of
computer hardware. Software, on the other hand, consists of the programs and applications that run
on computers. Because software runs on computer hardware, software programs often have system
requirements that list the minimum hardware required for the software to run.

Software - refers to the set of electronic program instructions or data a computer processor reads in
order to perform a task or operation. In contrast, the term 'hardware' refers to the physical
components that you can see and touch, such as the computer hard drive, mouse, and keyboard.
Software can be categorized according to what it is designed to accomplish. There are two main
types of software: systems software and application software.

Systems Software
Systems software includes the programs that are dedicated to managing the computer itself, such as
the operating system, file management utilities, and disk operating system (or DOS). The operating
system manages the computer hardware resources in addition to applications and data. Without
systems software installed in our computers we would have to type the instructions for everything
we wanted the computer to do.

Applications Software
Application software, or simply applications, are often called productivity programs or end-user
programs because they enable the user to complete tasks, such as creating documents, spreadsheets,
databases and publications, doing online research, sending email, designing graphics, running
businesses, and even playing games! Application software is specific to the task it is designed for and
can be as simple as a calculator application or as complex as a word processing application. When
you begin creating a document, the word processing software has already set the margins, font style
and size, and the line spacing for you. But you can change these settings, and you have many more
formatting options available. For example, the word processor application makes it easy to add
color, headings, and pictures or delete, copy, move, and change the document's appearance to suit
your needs.
Program
This is a complete set of step-by-step instructions that control and direct the computer hardware in
carrying out a given task. Tasks may vary from very simple e.g. computing surface area to complex
ones like statistical analysis.
Programs are usually written to solve user problems on a computer.

Programming Language
This is a set of symbols and the rules that govern their rules that are employed in the construction of
a computer program.

Syntax
These are the rules of a language that govern the ways in which words, symbols, expressions and
statements may be formed and combined in that language.

Semantics
These are the rules of language that govern meaning of statements in any language.

Programmer
This is a person who is trained and/or specializes in the technique of creating, maintaining and
modifying computer programs.

Programming Languages

A programming language is a tool for developing executable models for a class of problem domains.
Programming languages provide the basic building block for all software. They are the means by
which people can tell the computer how to carry out a task.

Types of Structured Programming Language.

C - C is a high-level and general-purpose programming language that is ideal for developing


firmware or portable applications. Originally intended for writing system software, C was developed
at Bell Labs by Dennis Ritchie for the Unix Operating System (OS) in the early 1970s.
Ranked among the most widely used languages, C has a compiler for most computer systems and
has influenced many popular languages – notably C++
C is a structured, procedural programming language that has been widely used both for operating
systems and applications and that has had a wide following in the academic community. Many
versions of UNIX-based operating systems are written in C. C has been standardized as part of the
Portable Operating System Interface (POSIX).

Fortran - Fortran is a programming language mainly used by the scientific community. Its name is a
contraction of FORmula TRANslation, and its aim is to provide a way to tell computers to calculate
complicated mathematical expressions, with more ease than assembly language. FORTRAN is one
of the earliest programming languages. The original versions used punched cards to write programs
with. FORTRAN's age is both a strength and a weakness. On one hand, FORTRAN has a huge
number of libraries of code available. However, Fortran also has many archaic features, especially in
the earlier versions.
FORTRAN was designed for scientists and engineers, and has dominated this field. For the past 30
years FORTRAN has been used for such projects as the design of bridges and aeroplane structures,
it is used for factory automation control, for storm drainage design, analysis of scientific data and so
on. Throughout the life of this language, groups of users have written libraries of useful standard
FORTRAN programs.
COBOL - It is imperative, procedural and, since 2002, object-oriented. COBOL is primarily used in
business, finance, and administrative systems for companies and governments. COBOL is still
widely used in legacy applications deployed on mainframe computers, such as large-scale batch and
transaction processing jobs. But due to its declining popularity and the retirement of experienced
COBOL programmers, programs are being migrated to new platforms, rewritten in modern
languages or replaced with software packages. Most programming in COBOL is now purely to
maintain existing applications
LOGO - The Logo Programming Language, a dialect of Lisp, was designed as a tool for learning. Its
features - interactivity, modularity, extensibility, flexibility of data types - follow from this goal.
Although there are some versions of Logo that compile, it is generally implemented as an interpreted
language. The interactivity of this approach provides the user with immediate feedback on individual
instructions, thus aiding in the debugging and learning process. Error messages are descriptive. For
example
LISP - Lisp was originally created as a practical mathematical notation for computer programs,
influenced by the notation of Alonzo Church's lambda calculus. It quickly became the favored
programming language for artificial intelligence (AI) research. As one of the earliest programming
languages, Lisp pioneered many ideas in computer science, including tree data structures, automatic
storage management, dynamic typing, conditionals, higher-order functions, recursion, the self-
hosting compiler, closures, and the read–eval–print loop.

Pascal - A high-level programming language developed by Niklaus Wirth in the late 1960s. The
language is named after Blaise Pascal, a seventeenth-century French mathematician who constructed
one of the first mechanical adding machines. Pascal is best known for its affinity to structured
programming techniques. The nature of the language forces programmers to design programs
methodically and carefully. For this reason, it is a popular teaching language.
Despite its success in academia, Pascal has had only modest success in the business world. Part of
the resistance to Pascal by professional programmers stems from its inflexibility and lack of tools for
developing large applications. To address some of these criticisms, Wirth designed a new language
called Modula-2. Modula-2 is similar to Pascal in many respects, but it contains additional features.

History of Programming Languages

A program can be written in a variety of programming languages. The languages can broadly be
classified into two categories:

Low-level language – which refers to the machine language and assembly language.
High-Level languages: - which refers to languages such as COBOL, FORTRAN, BASIC
LOW LEVEL LANGUAGES

Machine Language (First Generation Language)


Digital computers represent and process data and instructions as binary numbers. This
representation of instructions and data is called machine language. Program instructions were
written as a series of binary digits (0’s and 1’s). When the program was entered into the computer
execution was direct since machine language needs no translation. The binary combination allowed
the program to have full access to and control the computers internal circuitry and memory
addresses.

Advantages
Program translation was fast because no conversion was required.
The program could directly address and control the internal circuitry meaning that these programs
were more effective in hardware usage and control.

Disadvantages
Writing programs was time consuming
Tracing errors in a program was extremely difficult.
Difficult to learn and use.
Program modification was cumbersome.
They were machine dependent i.e. a program created for one type of machine would not work on a
different type of machine.
To write an effective program the programmer had to have expert knowledge on the computer’s
internal workings.

Assembly Language (Second Generation)

This language was more user oriented than machine language. Instructions are represented using
mnemonic code and symbolic addresses. Words like add, sum etc could be used in programs. An
assembler translated these codes into machine language.

Advantages
Much easier to learn compared to machine language.
Coding took less time than coding using machine language.
Error correction was less cumbersome.

Disadvantages
Were also machine specific
Execution took longer than machine language programs due to the translation process.
HIGH LEVEL LANGUAGES

These languages are user friendly and problem oriented compared to the low level languages.
Programs written in high level languages are shorter than the machine language programs.

They have an extensive vocabulary of words and symbols therefore program instructions are written
using familiar English-like statements and mathematical statements.

A single high-level language program is translated into multiple machine code instructions.

Advantages
They are portable i.e. they can be used on more than one type of machine.
Creating program and error correction takes less time.
Are relatively easy to learn and use.
The programmer does not have to be an expert on the internal workings of the machine.

Disadvantages
Program execution takes more time due to the translation process.
They do not address the internal circuitry of computers as effectively as the low level languages.
A translated program will occupy more space.

High level languages can further be classified into :


Procedural languages (Third Generation)
Non-Procedural Languages (Fourth Generation Languages or 4GLs)

Procedural languages (Third Generation).

They require the programmer to specify step-by-step how the computer will accomplish a specific
task. Program execution follows the exact sequence laid down by the programmer during coding.
Examples include FORTRAN, PASCAL, BASIC,

Non-Procedural Languages (Fourth Generation Languages or 4GLs).

They allow the programmer to specify the desired result without having to specify the detailed
procedure needed to achieve the result.

They are more user oriented and allow programmers to develop programs with fewer commands
compared with 3rd generation languages. They are called non procedural because programmers can
write programs that need only tell the computer what they want done, not all the procedures of
doing it.
4GL consists of:
Report Generators: also called report writers. This is a program for end users that is used to
produce reports.
Query Language: This is an easy to use language for retrieving data from a database management
system.
Application Generators: This is a program’s tool that allows a person to give a detailed explanation
of what data to be processed. The software then generates codes needed to create a program to
perform the tasks.

Object Oriented Programming Languages

OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented


Programming (OOP) uses a different set of programming languages than old procedural
programming languages (C, Pascal, etc.). Everything in OOP is grouped as self sustainable "objects".
Hence, you gain re-usability by means of four main object-oriented programming concepts.

An object can be considered a "thing" that can perform a set of related activities. The set of
activities that the object performs defines the object's behavior. For example, the hand can grip
something or a Student (object) can give the name or address.

Fifth-generation programming language

A fifth generation (programming) language (5GL) is a grouping of programming languages build on


the premise that a problem can be solved, and an application built to solve it, by providing
constraints to the program (constraint-based programming), rather than specifying algorithmically
how the problem is to be solved (imperative programming).

In essence, the programming language is used to denote the properties, or logic, of a solution, rather
than how it is reached. Most constraint-based and logic programming languages are 5GLs. A
common misconception about 5GLs pertains to the practice of some 4GL vendors to denote their
products as 5GLs, when in essence the products are evolved and enhanced 4GL tools.

PROGRAMMING PARADIGMS.

Programming paradigms are a way to classify programming languages according to the style of
computer programming. Features of various programming languages determine which programming
paradigms they belong to; as a result, some languages fall into only one paradigm, while others fall
into multiple paradigms. Some paradigms are concerned mainly with implications for the execution
model of the language, such as allowing side effects, or whether the sequence of operations is
defined by the execution model. Other paradigms are concerned mainly with the way that code is
organized, such as grouping code into units along with the state that is modified by the code. Yet
others are concerned mainly with the style of syntax and grammar. A programming paradigm is an
approach to solving programming problems.
1) Un structured programming.

An unstructured program is a procedural program – the statements are executed in sequence as


written. But this type of programming uses the goto statement. A goto statement allows control to
be passed to any other place in the program. When a goto statement is executed, the sequence
continues from the target of the goto. Thus to understand how a program works, you have to
pretend to execute it. This means that it is often difficult to understand the logic of such a program.
Some program compilers cross-index where a goto connects to, making it practical to rapidly
navigate the source code. However, it was a common practice in some programming languages to
use a variable in association with where the goto goes, making automated indexing impractical.
There are similar problems in some structured programming languages, such as how foreign
language views are implemented, to permit many people to view the same computer data, in their
human language.

2) Structured programming
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. Certain languages such as Ada, Pascal, and dBASE are
designed with features that encourage or enforce a logical program structure.
A technique for organizing and coding computer programs in which a hierarchy of modules is used,
each having a single entry and a single exit point, and in which control is passed downward through
the structure without unconditional branches to higher levels of the structure. Three types of control
flow are used: sequential, test, and iteration.

3) Object Oriented Programming

Object Oriented Programming (OOP) is a paradigm in which real-world objects are each viewed as
seperate entities having their own state which is modified only by built in procedures, called
methods. Because objects operate independently, they are encapsulated into modules which contain
both local environments and methods. Communication with an object is done by message passing.
Object-oriented programming (OOP) is a programming language model organized around objects
rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical
procedure that takes input data, processes it, and produces output data.

4) Visual Programming.
In computing, a visual programming language (VPL) is any programming language that lets users
create programs by manipulating program elements graphically rather than by specifying them
textually. A VPL allows programming with visual expressions, spatial arrangements of text and
graphic symbols, used either as elements of syntax or secondary notation. For example, many VPLs
(known as dataflow or diagrammatic programming) are based on the idea of "boxes and arrows",
where boxes or other screen objects are treated as entities, connected by arrows, lines or arcs which
represent relations.
5) Internet Based programming.

Web programming refers to the writing, markup and coding involved in Web development, which
includes Web content, Web client and server scripting and network security. The most common
languages used for Web programming are XML, HTML, JavaScript, Perl 5 and PHP. Web
programming is different from just programming, which requires interdisciplinary knowledge on the
application area, client and server scripting, and database technology.
Web programming can be briefly categorized into client and server coding. The client side needs
programming related to accessing data from users and providing information. It also needs to ensure
there are enough plug ins to enrich user experience in a graphic user interface, including security
measures.
To improve user experience and related functionalities on the client side, JavaScript is usually used.
It is an excellent client-side platform for designing and implementing Web applications.
HTML5 and CSS3 supports most of the client-side functionality provided by other application
frameworks.

Hardware and Software Considerations for Structured Programming.

- Structured programs written for one system can be run with little or no modification on other
systems.
- There are several Pascal compilers and interpreters available for general use. Among these are:
-86,
DOS, Windows and Macintosh.
- and 64-
bit Windows operating systems, as well as 32-bit Mac OS X and iOS. Embarcadero is planning to
build support for the Linux and Android operating system.

compiler is a 32- and 64-bit Turbo Pascal and Delphi compatible Pascal compiler for Linux,
Windows, OS/2, FreeBSD, Mac OS X, DOS and several other platforms.

syntax.
compiler for the .NET and Mono platforms.

Collection.

- The source code written in source file is the human readable source for your program. It needs to
be "compiled", to turn into machine language so that your CPU can actually execute the program as
per instructions given.
This C programming language compiler will be used to compile your source code into final
executable program. Most frequently used and free available compiler is GNU C/C++ compiler.

Hardware requirements.
Architecture
All computer operating systems are designed for a particular computer architecture. Most software
applications are limited to particular operating systems running on particular architectures. Although
architecture-independent operating systems and applications exist, most need to be recompiled to
run on a new architecture.
Processing power
The power of the central processing unit (CPU) is a fundamental system requirement for any
software. Most software running on x86 architecture define processing power as the model and the
clock speed of the CPU. Many other features of a CPU that influence its speed and power, like bus
speed, cache, and MIPS are often ignored. This definition of power is often erroneous, as AMD
Athlon and Intel Pentium CPUs at similar clock speed often have different throughput speeds. Intel
Pentium CPUs have enjoyed a considerable degree of popularity, and are often mentioned in this
category.

Memory
All software, when run, resides in the random access memory (RAM) of a computer. Memory
requirements are defined after considering demands of the application, operating system, supporting
software and files, and other running processes. Optimal performance of other unrelated software
running on a multi-tasking computer system is also considered when defining this requirement.
Secondary storage
Hard-disk requirements vary, depending on the size of software installation, temporary files created
and maintained while installing or running the software, and possible use of swap space (if RAM is
insufficient).
Display adapter
Software requiring a better than average computer graphics display, like graphics editors and high-
end games, often define high-end display adapters in the system requirements.
Peripherals
Some software applications need to make extensive and/or special use of some peripherals,
demanding the higher performance or functionality of such peripherals. Such peripherals include
CD-ROM drives, keyboards, pointing devices, network devices, etc.

Software requirements
Software requirements deal with defining software resource requirements and prerequisites that need
to be installed on a computer to provide optimal functioning of an application. These requirements
or prerequisites are generally not included in the software installation package and need to be
installed separately before the software is installed.
Platform
A computing platform describes some sort of framework, either in hardware or software, which
allows software to run. Typical platforms include a computer's architecture, operating system, or
programming languages and their runtime libraries.
Operating system is one of the requirements mentioned when defining system requirements
(software). Software may not be compatible with different versions of same line of operating
systems, although some measure of backward compatibility is often maintained. For example, most
software designed for Microsoft Windows XP does not run on Microsoft Windows 98, although the
converse is not always true. Similarly, software designed using newer features of Linux Kernel v2.6
generally does not run or compile properly (or at all) on Linux distributions using Kernel v2.2 or
v2.4.
APIs and drivers
Software making extensive use of special hardware devices, like high-end display adapters, needs
special API or newer device drivers. A good example is DirectX, which is a collection of APIs for
handling tasks related to multimedia, especially game programming, on Microsoft platforms.

You might also like