0% found this document useful (0 votes)
7 views24 pages

CP Chapter 3

Chapter Three introduces computer programming, defining it as the skill of writing instructions for computers to perform tasks. It outlines essential skills for programmers, including proficiency in programming languages, problem-solving, and algorithm development, while also categorizing programming languages into machine, assembly, and high-level languages. The chapter further discusses the evolution of programming languages through generations and various programming paradigms, emphasizing the importance of software engineering and the software development life cycle (SDLC) in delivering high-quality software products.

Uploaded by

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

CP Chapter 3

Chapter Three introduces computer programming, defining it as the skill of writing instructions for computers to perform tasks. It outlines essential skills for programmers, including proficiency in programming languages, problem-solving, and algorithm development, while also categorizing programming languages into machine, assembly, and high-level languages. The chapter further discusses the evolution of programming languages through generations and various programming paradigms, emphasizing the importance of software engineering and the software development life cycle (SDLC) in delivering high-quality software products.

Uploaded by

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

CHAPTER THREE

INTRODUCTION TO PROGRAMMING
WHAT IS COMPUTER PROGRAMMING?
•Programming is a skill that can be acquired by a computer professional
that gives him/her the knowledge of making the computer perform the
required operation or task .

• Writing computer programs means writing instructions that will make the
computer follow and run a program based on those instructions.

•Each instruction is relatively simple, yet because of the computer's speed,


it can run millions of instructions in a second.

•Programming Language: is a set of different categories of written symbols


that instruct computer hardware to perform specified operations required
by the designer.
WHAT SKILLS DO WE NEED TO BE A PROGRAMMER?
• For someone to be a programmer, in addition to basic skills in
computer, he/she needs to have the following major skills
• Programming Language Skill: knowing one or more programming languages to talk to
the computer and instruct the machine to perform a task.
• Problem Solving Skill: skills on how to solve the real-world problem and represent the
solution in an understandable format.
• Algorithm Development Skill: the skill of coming up with the sequence of a simple and
human-understandable set of instructions showing the step of solving the problem. Those
set of steps should not be dependent on any programming language or machine.

• In every programming language, there are sets of rules that govern the
symbols to be used in the programming language.
• This set of rules determine how the programmer can make the
computer hardware to perform a specific operation. These sets of rules
are called syntax.
REASONS TO STUDY PROGRAMMING

Increased capacity to express programming


concepts
Increased ability to learn new languages
Understand the significance of implementation
Increased ability to design new languages
Mastering different programming paradigms
To solve problems
WHAT IS A PROGRAMMING LANGUAGE?
• Programming Language is a set of different categories
of written symbols that instruct computer hardware to
perform specified operations required by the designer.
• Programming Language can be dividing into three
major categories.
• Machine Language
• Assembly Language
• High-Level Language
MACHINE LANGUAGE
• The off switch is designated by a 0, and the on switch is designated by a 1.
• Because computers can understand only these on and off switches, the first
programmers had to write the program instructions using nothing but
combinations of 0s and 1s.
• For example, a program might contain the instruction 00101 10001 10000.
Instructions written in 0s and 1s are called machine language or machine code.
• The machine languages (each type of machine has its language) represent the
only way to communicate directly with the computer.
• As you can imagine, programming in machine language is very tedious and
error-prone and requires highly trained programmers
• The advantage of machine language is the fact that it is translation free and
high speed and while its disadvantage is that machine language is machine-
dependent, complex, and error-prone.
ASSEMBLY LANGUAGE
• Assembly language is close to a one-to-one correspondence between
symbolic instruction and executable machine code and was created to use
letters instead of 0s and 1s.
• For example, most assembly languages use the mnemonic ADD to represent
an add operation and the mnemonic MUL to represent a multiply operation.
• An example of an instruction written in an assembly language is ADD BX, AX.
• Programs written in an assembly language require an assembler, which also
is a program, that converts the assembly instructions into machine code the
0s and 1s the computer can understand.
• The advantage of assembly language is that it is easy to understand and
use, less error-prone. Its disadvantages are its machine dependency and
harder to learn natures.
HIGH-LEVEL LANGUAGE
• High-level languages represent the next major development in programming
languages.
• High-level languages are a vast improvement over machine and assembly languages
because they allow the programmer to use instructions that more closely resemble
the English language.
• An example of an instruction written in a high-level language is, grossPay = hours *
rate.
• Besides, high-level languages are more machine-independent than are machine and
assembly languages.
• As a result, programs written in a high-level language can be used in many different
types of computers.
• Programs are written in a high-level language usually require a compiler, which also
is a program, to convert the English-like instructions into the 0s and 1s the computer
can understand.
Adv and disadv Of High-level
• Advantage
• readability,
• machine independence,
• easy debugging,
• easier maintenance, and
• low development cost nature

• Disadv
• poor control in hardware
• less efficiency
GENERATION OF PROGRAMMING LANGUAGE
• These programming languages can also be categorized into two broad
categories:
• low level and high-level languages.
• Low-level languages are machine specific or dependent.
• High-level languages like COBOL and BASIC are machine independent and
can run on a variety of computers.
• From the five categories of programming languages, first- and second-
generation languages are low-level languages and the remaining
categories are high-level programming languages.
• The higher the level of a language, the easier it is to understand and use
by programmers.
• Languages after the fourth generation are referred to as a very high-level
language.
FIRST GENERATION (MACHINE LANGUAGES, 1940’S)

• Difficult to write applications with.


• Dependent on machine languages of the specific
computer being used.
• Machine languages allow the programmer to interact
directly with the hardware, and it can be executed by
the computer without the need for a translator.
• Is more powerful in utilizing the resources of the
computer.
• They execute very quickly and use memory very
efficiently.
SECOND GENERATION (ASSEMBLY LANGUAGES, EARLY 1950’S)

• Uses symbolic names for operations and storage


locations.
• A system program called an assembler translates a
program written in assembly language to machine
language.
• Programs written in assembly language are not
portable. That is different computer architectures have
their machine and assembly languages.
• They are highly used in system software development
THIRD GENERATION (HIGH-LEVEL LANGUAGES, 1950’S TO
1970S)
• Uses English like instructions and mathematicians were able to define
variables with statements such as Z = A + B
• Such languages are much easier to use than assembly language.
• Programs written in high-level languages need
• The use of common words (reserved words) within instructions makes
it easier to learn.
• All third-generation programming languages are procedural
languages.
• In procedural languages, the programmer is expected to specify what
is required and how to perform it.
FOURTH GENERATION (SINCE THE LATE 1970S)

• Have a simple, English language like syntax rules;


commonly used to access databases.
• Fourth-generation languages have a minimum number
of syntax rules. This saves time and free professional
programmers for more complex tasks.
• Some examples of 4GL are structured query languages
(SQL), report generators, application generators, and
graphics languages.
FIFTH GENERATION (1990’S)

• These are used in artificial intelligence (AI) and expert


systems; also used for accessing databases.
• 5GLs are “natural” languages whose instruction closely
resembles human speech.
• 5GLs require very powerful hardware and software
because of the complexity involved in interpreting
commands in human language
• .
MAJOR PROGRAMMING PARADIGM
• The major landmarks in the programming world are the
different kinds of features or properties observed in the
development of programming languages.
• As might be expected in a dynamic and evolving field, there
is no single standard for classifying programming languages.
• Another most fundamental way programming languages are
characterized (categorized) is by programming paradigm.
• A programming paradigm provides the programmer's view of
code execution.
PROCEDURAL PROGRAMMING PARADIGMS
• Procedural programming specifies a list of operations that the
program must complete reaching the desired state
• Each program has a starting state, a list of operations to
complete, and an ending point.
• This approach is also known as imperative programming.
• Integral to the idea of procedural programming is the concept of a
procedure call.
• Procedures, also known as functions, subroutines, or methods, are
small sections of code that perform a particular function.
• A procedure is effectively a list of computations to be carried out.
• Procedural programming can be compared to unstructured
programming, where all of the code resides in a single large
block
• By splitting the programmatic tasks into small pieces,
procedural programming allows a section of code to be re-used
in the program without making multiple copies.
• It also makes it easier for programmers to understand and
maintain the program structure.
• Two of the most popular procedural programming languages are
FORTRAN and BASIC
STRUCTURED PROGRAMMING PARADIGMS

•Structured programming is a special type of procedural programming.

•It provides additional tools to manage the problems that larger programs
were creating.

•Structured programming requires that programmers break program


structure into small pieces of code that are easily understood.

•It also frowns upon the use of global variables and instead uses variables
local to each subroutine.

• One of the well-known features of structural programming is that it does


not allow the use of the GOTO statement.
•It is often associated with a "top-down" approach to design.

•The top-down approach begins with an initial overview of the


system that contains minimal details about the different parts.

• Subsequent design iterations then add increasing detail to the


components until the design is complete.
•The most popular structured programming languages include C,
Ada, and Pascal.
OBJECT-ORIENTED PROGRAMMING PARADIGMS

• Object-oriented programming is one of the recent and most powerful


paradigms.
• In object oriented programs, the designer specifies both the data
structures and the types of operations that can be applied to those
data structures.
• This pairing of a piece of data with the operations that can be
performed on it is known as an object.
• A program, thus, becomes a collection of cooperating objects, rather
than a list of instructions.
• Objects can store state information and interact with other objects,
but generally, each object has a distinct, and limited role.
PROBLEM SOLVING PROCESS
AND SOFTWARE ENGINEERING
SOFTWARE ENGINEERING
• Software engineering is the  The software development life
profession that creates and cycle has the following phases.
maintains software applications • Feasibility study, requirement
• By applying technologies and gathering, and analysis
practices from computer science, • Design
project management, engineering,
• Implementation or coding
application domain, and other fields.
• Testing
• The method used in solving problems
in computer science and/or • Deployment and maintenance
information systems is called the
software development life cycle
(SDLC).
SOFTWARE DEVELOPMENT LIFE CYCLE (SDLC)

•SDLC is a process that defines the various stages involved in the


development of software for delivering a high-quality product.

•SDLC stages cover the complete life cycle of software i.e., from
inception to retirement of the product.

• The purpose of SDLC is to deliver a high-quality product that is as per


the customer’s requirement.

•SDLC has defined its phases as, Requirement gathering, Designing,


Coding, Testing, and Maintenance.

•It is important to adhere to the phases to provide the Product


systematically.

You might also like