Comprog1 - Lecture 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

AY 2019-2020

COMPUTER
PROGRAMMING 1
Prepared By:
Prof. Jomariss B. Plan, MSIT, SMRIIT
Dr. Joel B. Mangaba, FRIIT
CCS Faculty
Week 1:
REVIEW IN PROGRAMMING CONCEPTS
Learning Outcomes
At the end of the topic session, the students should be
able to:
• Explain the Concepts of Programming Language
• Apply qualities of a good program design in
development process.
• Decide the resources required in programming.
Program

A program is a set of instructions written in a


language (such as Java) understandable by the
computer to perform a particular function on
the computer. A well written program could be
parceled well to form an application package
customized for solving specific type of problem
on the computer system
Computer Programmer

A computer programmer is computer scientist


(a professional) skilled in using constructs of
programming languages to develop executable
and acceptable computer programs. A software
developer is a programmer. Programmers often
work hand in hand with system analysts on
large projects.
Programming

Programming is the art of developing computer


programs with the aid of selected programming
language by a computer programmer. It is a
special skill whose quality is tested by the
quality of the resulting program or software.
Programming Language
Programming languages are artificial notational
languages created or developed to be used in
preparing coded instructions on the computer
for later execution by the computer. They are
usually composed of series of usage rules
(syntax) that determine the meaning
(semantics) of expressions written in the
language.
What’s new in Programming Language?

• Commercial trend over the past 5+ years


• Teaching trends
• Research and Development Trends
Types of Programming Languages

• Machine Language
• Assembly Language
• High-level Language
• 4GL
Programming Languages: Generations

 First Generation
 Machine language
 Second Generation
 Assembly language
 Third Generation
 “High-level” languages such as Pascal, C, COBOL, Fortran
 Fourth Generation
 Scripting languages such as SQL, Applescript, VBScript
 Fifth Generation?
 Natural language? Automatic code generation? Object-
oriented languages?
MACHINE LANGUAGES
• The lowest level of programming language.
• Only understood by computers and consists pure
numbers.
• Machine language consists of strings of binary
numbers (i.e. 0s and 1s) and it is the only one
language, the processor directly understands.
ASSEMBLY LANGUAGES
• It is similar to machine language but assembly
language is much easier to understand than
machine language.
• This language uses mnemonics code (symbolic
operation code like ‘ADD’ for addition) in place of
0s and 1s. The program is converted into machine
code by assembler.
• Op Code and Operand
HIGH-LEVEL LANGUAGES

• Considered high-level because it’s closer


to human language.
• Allows the programmer to focus on
solving the problem rather than
knowing how to program the computer.
History of Programming Languages
History of Programming Languages
History of Programming Languages
History of Programming Languages

COBOL (Common Business


Oriented Language)
• The most frequently used
business programming
language (business, education,
and government)
• Dr. Grace Murray Hopper
(early 1960’s)
History of Programming Languages

PASCAL
• Pascal was named after French
Mathematician Blaise Pascal.
• Niklaus Wirth (late 1960’s)
History of Programming Languages
History of Programming Languages
History of Programming Languages
History of Programming Languages

C Language
• Dennis Ritchie (1972)
• It was influenced by another
language called B developed
by Ken Thompson.
• Used to write Operating
Systems programs.
History of Programming Languages

C++ Language
• developed by Bjarne
Stroustrup.
• Superset of C.
History of Programming Languages
Procedures in Programming

Six step procedure


 Program specification
 Program design
 Program code
 Program test
 Program documentation
 Program maintenance
Programming: Step 1 – Program Specification
 Also called program definition or program analysis
 Five steps to complete in the process
 Objectives – problems you are trying to solve
 Outputs – desired output
 Needed input data – user input or processed
 Required Processing - formula
 Documentation
Programming: Step 2 – Program Design
 It is the process that organizations use to develop a
program.
 Ideally, the process is collaborative, iterative, and
tentative—stakeholders work together to repeat,
review, and refine a program until they believe it
will consistently achieve its purpose
Programming: Step 3 – Program Code
 Writing the program or coding
 Characteristics of a good program
 Works reliably
 Produces the
correct output
 Catches common
input errors
 Code is well-documented
and understandable
 Uses an appropriate
computer language
Programming: Step 4 – Program Test
 Debugging to test code and eliminate errors
 Syntax errors
 Logic errors
 Testing process
Programming: Step 5 – Program Documentation

 Written descriptions about a program


 Important for people who will use and/or support
the program
 Users
 Operators
 Programmers
Programming: Step 6 – Program Maintenance

 75% of total lifetime cost


 Ensures program is
 Error-free
 Effective
 Efficient
 Two activity categories
 Operations
 Changing needs
Assignment 1:
Differentiate the following and provide sample
programming languages for each:
Functional
Declarative
Imperative
Object-Oriented
Program Development Life Cycle

 Program Development Life Cycle (PDLC) is a


systematic way of developing quality software. It
provides an organized plan for breaking down the
task of program development into manageable
chunks, each of which must be successfully
completed before moving on to the next phase.
Step 1: Defining the Problem

 The first step is to define the problem. In major


software projects, this is a job for system analyst,
who provides the results of their work to
programmers in the form of a program
specification. The program specification defines the
data used in program, the processing that should
take place while finding a solution, the format of
the output and the user interface.
Step 2: Designing the Program

 Program design starts by focusing on the main goal


that the program is trying to achieve and then
breaking the program into manageable
components, each of which contributes to this
goal. This approach of program design is called top-
bottom program design or modular programming.
For each module, programmer draws a conceptual
plan using an appropriate program design tool to
visualize how the module will do its assign job.
Step 3: Coding the Program

 Coding the program means translating an


algorithm into specific programming language. The
technique of programming using only well defined
control structures is known as Structured
programming.
Step 4: Testing and Debugging the Program
 After removal of syntax errors, the program will execute.
However, the output of the program may not be correct.
This is because of logical error in the program. A logical
error is a mistake that the programmer made while
designing the solution to a problem. So the programmer
must find and correct logical errors by carefully examining
the program output using Test data. Syntax error and
Logical error are collectively known as Bugs. The process of
identifying errors and eliminating them is known
as Debugging.
Step 5: Documenting the Program
 After testing, the software project is almost complete.
The structure charts, pseudocodes, flowcharts and decision
tables developed during the design phase become
documentation for others who are associated with the
software project. This phase ends by writing a manual that
provides an overview of the program’s functionality,
tutorials for the beginner, in-depth explanations of major
program features, reference documentation of all program
commands and a thorough description of the error
messages generated by the program.
Step 6: Deploying the Program
 In the final phase, the program is deployed (installed) at
the user’s site. Here also, the program is kept under watch
till the user gives a green signal to it.
Even after the software is completed, it needs to be
maintained and evaluated regularly. In software
maintenance, the programming team fixes program errors
and updates the software.
Characteristics of a Good Program

• Portability
• Maintainability
• Efficient
• Reliable
• Machine Independence
• Cost Effectiveness
• Flexible
References

Online
http://www.cs.tau.ac.il/~msagiv/courses/pl17/overview.pdf
https://www.researchgate.net/publication/317182495_INTRODUCTION_TO_COMPUT
ER_PROGRAMMING_BASIC
https://en.wikipedia.org/wiki/C%2B%2B
https://www.geeksforgeeks.org/software-engineering-program-development-life-
cycle-pdlc/
https://www.etutorialspoint.com/index.php/8-characteristics-of-a-good-computer-
program

You might also like