PROGRAMMING
CONCEPT
(MODULE 1)
“
2
OBJECTIVES
▰ Explain the history of programming languages
▰ Learn about the language of a computer
▰ Learn about the evolution of programming languages
▰ Understand the programming process
▰ Understand algorithm
3
1
INTRODUCTION TO
PROGRAMMING LANGUAGE
Programming Concept
4
"Top Programming Languages" by daniel_iversen is licensed
under CC BY 2.0
5
PROGRAMMING TERMINOLOGIES
▰ Programming – giving a mechanism the directions to
accomplish a task.
▰ Computer Programs –A set of written instructions that
tells the computer what to do
▰ Programmers – people who write programs
▰ Programming Languages – special languages used by the
programmers to communicate with the computer. It contain
instructions for the computer
6
PROGRAMMING TERMINOLOGIES
▰ Machine language
▻ The most basic circuitry-level language
▻ A low-level programming language
▰ Syntax: rules governing word usage and punctuation in the
language
▰ Coding is the process of translating a computer solution
into a language a computer can understand
▰ Debugging - Freeing program of all errors
7
PROGRAMMING TERMINOLOGIES
▰ Program statements
▻ Similar to English sentences
▻ Commands to carry out program tasks
▰ Compiler or interpreter: software that translates
programming languages to machine language
8
PROGRAMMING TERMINOLOGIES
▰ Syntax error
▻ Misuse of language rules
▻ A misspelled programming language word
▰ Logic errors
▻ Also called semantic errors
▻ Incorrect order or procedure
▻ The program may run but provide inaccurate output
9
"The Evolution of Computer Programming Languages #C #Fortran #Java
#Ruby" by dullhunk is licensed under CC BY 2.0 10
History of PL
Video Presentations (Click the link to
watch or type the link below to the
browser)
https://youtu.be/Pn5znSOGHcs (History and Evolution of
PL)
https://youtu.be/mhpslN-OD_o
11
12
LANGUAGE OF A COMPUTER
Machine Assembly High-Level
13
MACHINE LANGUAGE
Machine Languages – known also as machine code. Instructions written in 0s and 1s.
Example: 10010 00110 111000
Within a computer, all data is represented by microscopic electronic switches
that can be either off or on.
0 – off ; 1 – on
14
MACHINE LANGUAGE
15
ASSEMBLY LANGUAGE
Assembly Languages – simplify the programmer’s job by allowing the programmer
to use mnemonics in place of the 0s and 1s
Mnemonics – are memory aids, alphabetic abbreviations for instructions
Example: ADD ax, bx
Programs written in an assembly language require an assembler, which
also is a program. To convert the assembly instructions into machine code – the
computer can understand.
16
HIGH-LEVEL LANGUAGE
High-Level Languages – Allows the programmer to use instructions that more
closely resemble the English Language
Example: grossPay = hours * rate
Programs written in high-level language require a compiler and interpreter.
Compiler – translates all of a program’s high-level instructions before running the
programs.
Interpreter – translates the instructions line by line as the program is running.
17
HIGH-LEVEL LANGUAGE
PROCEDURAL OBJECT-ORIENTED
the programmer concentrates on the requires the programmer to focus on
major tasks that the program needs to the objects that the program can use
perform. to accomplish its goal.
Example:
▰ COBOL (Common Business Oriented Example: C++, Visual Basic, C#, Java (but
Language) this can also be used to create procedure-
▰ BASIC (Beginner’s All Purpose Symbolic oriented programs)
Instruction Code)
▰ C-Language
18
2
THE PROBLEM SOLVING
PROCESS
Programming Concept
19
PROGRAMMING PROCESS (Phases)
▰ Understand the problem
▰ Plan the logic
▰ Code the program
▰ Use software to translate the program to machine language
▰ Test the program
▰ Put the program into production
20
Understand the problem
▰ May be the most difficult phase
▰ Users may not be able to articulate their needs well
▰ User needs may be changing frequently
▰ Programmers may have to learn the user’s functional job tasks
▰ Failure to understand the problem is the major cause of most project failures
21
Plan the logic
▰ Plan the steps that the program will take
▰ Use tools such as flowcharts and pseudocode
▰ Flowchart: a pictorial representation of the logic steps
▰ Pseudocode: Natural language representation of the logic
22
Code the program
▰ Select the programming language
▻ Some languages more efficient for certain tasks
▻ All languages handle input, arithmetic processing, output, other standard
functions
▻ Logic can be executed in any number of languages
▰ Write the instructions
▰ Planning generally more difficult than coding
23
Use software to translate the program to machine language
▰ Programmers write instructions in high-level languages that resemble a natural
language
▰ Compilers or interpreters change the programs into a low-level machine language
that can be executed
▰ Syntax errors are identified by the compiler or interpreter
24
Test the program
▰ Execute it with sample data and check results
▰ Identify logic errors and correct them
▰ Choose test data carefully to exercise all branches of the logic
25
Putting the Program into Production
▰ Might mean simply running the program once
▰ Process might take months if program is used on regular basis or is part of larger
development
▻ Train data-entry people and users
▻ Change existing data
▰ Conversion: entire set of actions organization must take to switch over to new
program(s)
26
3
ALGORITHM CONCEPT
Programming Concept
27
ALGORITHM
▰ A step-by-step problem-solving process in which a solution
is arrived at in a finite amount of time
▰ Step by step instructions that accomplish the task
▰ By flowcharting or pseudocode
28
EXAMPLE OF • What is an Algorithm? - D
efinition & Examples - Vid
ALGORITHM eo & Lesson Transcript |
Study.com
Click the following link
for video presentation • https://youtu.be/6hfOvs8
about algorithm pY1k
29
Problem-Solving Process
1. Analyze the problem and outline the problem and its solution requirements
2. Design an algorithm to solve the problem
3. Implement the algorithm in a programming language
4. Verify that the algorithm works
5. Maintain the program by using and improving it and modifying it if the problem
domain changes
30
REFERENCES
Books:
▰ Farrell, J. (2018). Programming Logic and Design, Comprehensive, 9th Ed. Cengage Learning.
▰ Farrell, J. (2015). Java Programming, 8th Ed. Cengage Learning.
▰ Malik, D.S. (2012). Java Programming: From Problem Analysis to Program Design. Course Technology, Cengage
Learning.
▰ Zak, D. (2016). An Introduction to Programming with C++, Sixth Edition. Cengage Learning.
31
REFERENCES
Website/Online Resources:
▰ https://lawtomated.com/coding-for-beginners-what-to-learn-where-how-and-why-part-2/
▰ https://study.com/academy/lesson/what-is-an-algorithm-definition-examples.html
Videos:
▰ https://youtu.be/Pn5znSOGHcs
▰ https://youtu.be/mhpslN-OD_o
▰ https://youtu.be/6hfOvs8pY1k
32
THANKS!
Any questions?
33
CREDITS
Special thanks to all the people who made and
released these awesome resources for free:
▰ Presentation template by SlidesCarnival
▰ Photographs by Startup Stock Photos
34