SlideShare a Scribd company logo
FP101
WEEK 5
CLO 1
Explain the basic computer and programming
fundamentals with appropriate examples of
language and technology
-Specify the Problem
-Analyze the problem
-Design the algorithm to solve the problem
-Implement the algorithm
-Test and verify the completed program
-Maintain and update the program
-Documentation
Programming Life Cycle
• There are 7 phases in programming Life Cycle:
Specify the Problem
Problem Statement
Compute and display the total cost apples
given the number of kilograms of apples
purchased and the cost per kilogram of
apples.
Compute and display the total price apples
given the weight in kilograms
of apples purchased and the price
per kilogram of apples.
Specify the Problem
• The first step in solving any problem is to
understand it.
• Read the requirements statement carefully.
• State the problem clearly and unambiguously.
• Gain clear understanding of what is required
for its solution.
Specify the Problem
• In problem requirement phase you may ask
some question like
a. What to compute?
b. What unit do they use?
c. Is it only for the apple or other fruit?
or any question for gaining understanding of
what is required.
Analyze the problem
• Identify the problem inputs you have to work
with and also the problems outputs (results)
desired.
• Check any additional requirements or
constraints on the solution.
• Determine the required format of the results
to be displayed.
• Develop a list of variables.
Analyze the problem
• To analyze the problem you may summarize the
information contained in it and find out the
problem input and output.
Problem Inputs
a. weight in kilogram
b. price per kilogram ( in RM per kg)
Problem Output
a. Total price (in RM)
Analyze the problem
• Develop a list of formulas that specify
relationships between the inputs and the
outputs:
Total price = price per kilogram x weight in kilogram
.
Analyze the problem
• Find a list of solution alternatives
Ex:
1. Define price per kilogram as constant
and weight in kilogram as input value
2. Define price per kilogram and weight in
kilogram as input values
Analyze the problem
• All the information gained from analyzing the
problem can be put into problem Analysis chart
(PAC)
Given Data Required Results
Weight in kilogram
Price per kilogram
Total price
Processing Required Solution Alternatives
Total price = price per
kilogram x weight in kilogram
1. Define price per kilogram as constant and
weight in kilogram as input value
*2. Define price per kilogram and weight in
kilogram as input values
Design the algorithm to solve the
problem
• Once you fully understand the problem and
have clarified any questions you have, you
need to develop your solution.
• Algorithm is a set of instructions for the
computer
• Setting up the algorithms is probably the
hardest part of problem solving on the
computer
Design the algorithm to solve the
problem
• The instructions cannot assume anything, cannot skip
steps, must be executable one step at a time and must
be complete
• Example of algorithm:
1. Input the weight in kilograms of apples
purchased and the price per kilogram of apples
2. Calculate total price apples using the formula:
Total price = price per kilogram x weight in kilogram
3. Print Total Price
Design the algorithm to solve the
problem
• Tools which can be used to help you in this task:
a) Structure Chart
b) IPO chart
c) flowchart
d) pseudocode
Design the algorithm to solve the
problem
a) Structure Chart
• Depict the overall organization of a program, show
how program segment or modules are defined and
how they relate to one another.
• The module in the upper row serve as control
functions directing the program to process modules
under them as appropriate.
• It follows a top-down design philosophy.
Design the algorithm to solve the
problem
a) Example : Structure Chart
TOTAL PRICE CONTROL
MODULE
0000
READ
1000
CALC
2000
PRINT
3000
Design the algorithm to solve the
problem
b) IPO (Input-Processing-Output) chart
- shows in more detail what data items are
input, what processing takes place on that
data and what information will be the end
result, the output
Design the algorithm to solve the
problem
b) Example : IPO (Input-Processing-Output) chart
Input processing Module reference
number
Output
Weight in kilogram
Price per kilogram
1. Enter Weight in
kilogram
2. Enter Price per
kilogram
3. Calculate Total
price
4. Print Total price
5. End
1000
1000
2000
3000
0000
Total price
Design the algorithm to solve the
problem
c) flowchart
- graphic representations of the algorithm
- shows the flow of processing from the
beginning to the end of a solution
- each block in a flowchart represents one
instruction from an algorithm
- flow lines indicate the direction of the data
flow
Design the algorithm to solve the
problem
start
Input WeightInKg, PricePerKg
TotalPrice = WeightInKg * PricePerKg
Print TotalPrice
end
c) Example : flow chart
Design the algorithm to solve the
problem
d) pseudo code
• Uses English like statements in place of the
flowchart graphical symbols.
• It is easier to code a program from it than from
flowchart.
• It is not tied to any programming language.
• It is easy to modify but not graphical, difficult to use
for logically complex problems, and slower to
create.
Design the algorithm to solve the
problem
d) Example : pseudo code
START
Input WeightInKg, PricePerKg
TotalPrice = WeightInKg * PricePerKg
Print TotalPrice
END
Implement the algorithm
• This step involves writing the algorithm as a
program.
• By using flow chart as the guideline, start
writing a program from the top of flow chart
and work your way to the bottom.
Implement the algorithm
• Example of program code in C++
#include <iostream.h>
int main()
{
float WeightInKg, PricePerKg, TotalPrice;
cout<<“ Enter weigh in Kg: “;
cin>> WeightInKg;
cout<<“ Enter price per kg: “;
cin>> PricePerKg;
TotalPrice= WeightInKg * PricePerKg;
cout<<“ Price of apples : RM “<<TotalPrice;
return 0;
}
Test and verify the completed
program
• After writing the program, you must test it.
• Program testing can be a very tedious and
time consuming.
• Run the program several times using the
different sets of data.
• Make sure that it works correctly for every
situation provided in the algorithm.
• Example: Blackbox Testing or Whitebox
testing.
Test and verify the completed
program
• Blackbox testing gets its name from the
concept of testing the program without
knowing what is inside- without knowing how
its works. By a user.
• Whitebox testing assumes that the tester
knows everything about the program. It is a
programmer’s responsibility.
Test and verify the completed
program
• Errors are so common that they have a special
name (BUGS). Bugs must be identified and
corrected.
• The process of identifying and correcting bugs
is known as debugging.
• When the compiler detects an error, the
computer will display an error message, which
indicates that you have made a mistake and
what the cause of the error might be.
Test and verify the completed
program
• Types of error in programming
- Syntax Error / Compiler Error
- Run-Time Error
- Logical Error
Test and verify the completed
program
• Syntax Error (Compilation Error)
– An error in the format of a statement in a
computer program that violates the rules of
the programming language employed.
– A program will not be executed until all syntax
errors are corrected
– Error can be traced at the event of compilation
Test and verify the completed
program
• Run –time error
– Are detected by the computer and are displayed
during execution of a program.
– A run-time error occurs when the program directs
the computer to perform an illegal operation,
such as dividing a number by zero or
Test and verify the completed
program
• Logical Error
– The hardest errors to find and fix.
– A logic error means although the language syntax
was used correctly, there was a misunderstanding:
if you want a, where b=c+a and you give a = b-a
instead of a = b-c, then you will get the wrong
answer, but have used the correct language
syntax.
Maintain and Update the program
• Maintenance and update are the modification
of a software product after delivery to correct
faults, to improve performance or other
attributes, or to adapt the product to a
modified environment.
Maintain and Update the program
• Types of maintenance
a) Corrective maintenance
- Reactive modification of a software
product performed after delivery to correct discovered
problems. It deals with fixing bugs in the code.
b) Adaptive maintenance
-Modification of a software product
performed after delivery to keep a software
product usable in a changed or changing
environment. It deals with adapting the
software to new environments.
Maintain and Update the program
• Types of maintenance
a) Perfective maintenance
-Modification of a software product after delivery to
improve performance or maintainability. It deals
with updating the software according to changes in
user requirements.
b) Preventive maintenance
-Modification of a software product after
delivery to detect and correct latent faults in
the software product before they become
effective faults. It deals with updating
documentation and making the software more
maintainable.
Documentation
• documentation should be concise so the person who
reads it doesn't have to spend too much time to find
what he or she is looking for.
• There are two types of documentation
a) internal documentation
- The comments you put in your source
code files should be written to help other
programmers navigate through your code
easily in order to find bugs or to determine
where to add new features.
Documentation
• There are two types of documentation
b) external documentation
-is made up of the manuals written about the
solution
-is written text that accompanies computer
software. It either explains how it operates or
how to use it, and may mean different things to
people in different roles.
Ad

Recommended

Bab 1 Asas Pengaturcaraan (MALAYSIA) G-Vecom
Bab 1 Asas Pengaturcaraan (MALAYSIA) G-Vecom
YouTuber,G-Vecom
 
Penghayatan etika dan peradaban ( mpu21032 )
Penghayatan etika dan peradaban ( mpu21032 )
NurAyuni31
 
Topik 6 perlembagaan sbg tapak integrasi
Topik 6 perlembagaan sbg tapak integrasi
SharifahNurAbu
 
Konsep Dan Asas Pengaturcaraan
Konsep Dan Asas Pengaturcaraan
ask3areu
 
Nota Subjek Sains Komputer Tingkatan 5 lengkap - SUBJEK MPEI
Nota Subjek Sains Komputer Tingkatan 5 lengkap - SUBJEK MPEI
Madrasah Idrisiah
 
Nota Subjek Sains Komputer Tingkatan 4 lengkap - SUBJEK MPEI
Nota Subjek Sains Komputer Tingkatan 4 lengkap - SUBJEK MPEI
Madrasah Idrisiah
 
2.0 menggunakan algoritma melalui pseudokod dan carta alir
2.0 menggunakan algoritma melalui pseudokod dan carta alir
Botol Budu
 
Masalah perpaduan di malaysia
Masalah perpaduan di malaysia
Deeba Arumugam
 
Sains komputer : struktur kawalan
Sains komputer : struktur kawalan
Madrasah Idrisiah
 
ANALISIS FUNGSI
ANALISIS FUNGSI
rodziah anuar
 
Tokoh –tokoh tamadun islam dan sumbangannya
Tokoh –tokoh tamadun islam dan sumbangannya
Izzat Najmi
 
Pembinaan negara bangsa
Pembinaan negara bangsa
Official : Kementerian Pelajaran Malaysia
 
5 maksud dan jenis perisian
5 maksud dan jenis perisian
wazi musa
 
SAINS KOMPUTER - AMALAN TERBAIK PENGATURCARAAN
SAINS KOMPUTER - AMALAN TERBAIK PENGATURCARAAN
Madrasah Idrisiah
 
Senarai nilai murni
Senarai nilai murni
Salwa Binti Bahadun Salwa
 
Nilai Agama dan Kepercayaan
Nilai Agama dan Kepercayaan
Ummul Kasturi
 
TINGKATAN 1 : RBT - Bab 4 : Lakaran
TINGKATAN 1 : RBT - Bab 4 : Lakaran
德 春
 
Penanda wacana karangan
Penanda wacana karangan
Azlan Haron
 
2 : Alkohol Dan Kesannya Kepada Kesihatan
2 : Alkohol Dan Kesannya Kepada Kesihatan
ROSNANI MOHAMED JAMALLUDIN
 
Perisian Aplikasi vs Perisian Sistem dan Ingatan Utama vs Storan Sekunder
Perisian Aplikasi vs Perisian Sistem dan Ingatan Utama vs Storan Sekunder
Gomaze Lang
 
2.1 sistem nombor perduaan
2.1 sistem nombor perduaan
tinalisalokman
 
Topik 3 etika dlm masyarakat kepelbagaian
Topik 3 etika dlm masyarakat kepelbagaian
SharifahNurAbu
 
Lukisan digital ppt
Lukisan digital ppt
Wong Lin
 
Hubungan Etnik - Konsep Asas
Hubungan Etnik - Konsep Asas
Mahyuddin Khalid
 
List of discourse markers
List of discourse markers
Ewani Islam
 
Konsep masyarakat majmuk
Konsep masyarakat majmuk
Bie Judith
 
Bab 1 Penyelesaian Masalah Secara Inventif -RBT T2
Bab 1 Penyelesaian Masalah Secara Inventif -RBT T2
Myu 21
 
(Pengajian malaysia) Sejarah dan latar belakang kaum di Malaysia
(Pengajian malaysia) Sejarah dan latar belakang kaum di Malaysia
Farah Hilmi
 
Introduction to Computer Programming
Introduction to Computer Programming
Prof. Erwin Globio
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai1
 

More Related Content

What's hot (20)

Sains komputer : struktur kawalan
Sains komputer : struktur kawalan
Madrasah Idrisiah
 
ANALISIS FUNGSI
ANALISIS FUNGSI
rodziah anuar
 
Tokoh –tokoh tamadun islam dan sumbangannya
Tokoh –tokoh tamadun islam dan sumbangannya
Izzat Najmi
 
Pembinaan negara bangsa
Pembinaan negara bangsa
Official : Kementerian Pelajaran Malaysia
 
5 maksud dan jenis perisian
5 maksud dan jenis perisian
wazi musa
 
SAINS KOMPUTER - AMALAN TERBAIK PENGATURCARAAN
SAINS KOMPUTER - AMALAN TERBAIK PENGATURCARAAN
Madrasah Idrisiah
 
Senarai nilai murni
Senarai nilai murni
Salwa Binti Bahadun Salwa
 
Nilai Agama dan Kepercayaan
Nilai Agama dan Kepercayaan
Ummul Kasturi
 
TINGKATAN 1 : RBT - Bab 4 : Lakaran
TINGKATAN 1 : RBT - Bab 4 : Lakaran
德 春
 
Penanda wacana karangan
Penanda wacana karangan
Azlan Haron
 
2 : Alkohol Dan Kesannya Kepada Kesihatan
2 : Alkohol Dan Kesannya Kepada Kesihatan
ROSNANI MOHAMED JAMALLUDIN
 
Perisian Aplikasi vs Perisian Sistem dan Ingatan Utama vs Storan Sekunder
Perisian Aplikasi vs Perisian Sistem dan Ingatan Utama vs Storan Sekunder
Gomaze Lang
 
2.1 sistem nombor perduaan
2.1 sistem nombor perduaan
tinalisalokman
 
Topik 3 etika dlm masyarakat kepelbagaian
Topik 3 etika dlm masyarakat kepelbagaian
SharifahNurAbu
 
Lukisan digital ppt
Lukisan digital ppt
Wong Lin
 
Hubungan Etnik - Konsep Asas
Hubungan Etnik - Konsep Asas
Mahyuddin Khalid
 
List of discourse markers
List of discourse markers
Ewani Islam
 
Konsep masyarakat majmuk
Konsep masyarakat majmuk
Bie Judith
 
Bab 1 Penyelesaian Masalah Secara Inventif -RBT T2
Bab 1 Penyelesaian Masalah Secara Inventif -RBT T2
Myu 21
 
(Pengajian malaysia) Sejarah dan latar belakang kaum di Malaysia
(Pengajian malaysia) Sejarah dan latar belakang kaum di Malaysia
Farah Hilmi
 
Sains komputer : struktur kawalan
Sains komputer : struktur kawalan
Madrasah Idrisiah
 
Tokoh –tokoh tamadun islam dan sumbangannya
Tokoh –tokoh tamadun islam dan sumbangannya
Izzat Najmi
 
5 maksud dan jenis perisian
5 maksud dan jenis perisian
wazi musa
 
SAINS KOMPUTER - AMALAN TERBAIK PENGATURCARAAN
SAINS KOMPUTER - AMALAN TERBAIK PENGATURCARAAN
Madrasah Idrisiah
 
Nilai Agama dan Kepercayaan
Nilai Agama dan Kepercayaan
Ummul Kasturi
 
TINGKATAN 1 : RBT - Bab 4 : Lakaran
TINGKATAN 1 : RBT - Bab 4 : Lakaran
德 春
 
Penanda wacana karangan
Penanda wacana karangan
Azlan Haron
 
Perisian Aplikasi vs Perisian Sistem dan Ingatan Utama vs Storan Sekunder
Perisian Aplikasi vs Perisian Sistem dan Ingatan Utama vs Storan Sekunder
Gomaze Lang
 
2.1 sistem nombor perduaan
2.1 sistem nombor perduaan
tinalisalokman
 
Topik 3 etika dlm masyarakat kepelbagaian
Topik 3 etika dlm masyarakat kepelbagaian
SharifahNurAbu
 
Lukisan digital ppt
Lukisan digital ppt
Wong Lin
 
Hubungan Etnik - Konsep Asas
Hubungan Etnik - Konsep Asas
Mahyuddin Khalid
 
List of discourse markers
List of discourse markers
Ewani Islam
 
Konsep masyarakat majmuk
Konsep masyarakat majmuk
Bie Judith
 
Bab 1 Penyelesaian Masalah Secara Inventif -RBT T2
Bab 1 Penyelesaian Masalah Secara Inventif -RBT T2
Myu 21
 
(Pengajian malaysia) Sejarah dan latar belakang kaum di Malaysia
(Pengajian malaysia) Sejarah dan latar belakang kaum di Malaysia
Farah Hilmi
 

Similar to 2.2 Demonstrate the understanding of Programming Life Cycle (20)

Introduction to Computer Programming
Introduction to Computer Programming
Prof. Erwin Globio
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai1
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai
 
CC-112-Lec.1.ppsx
CC-112-Lec.1.ppsx
Aamir Shahzad
 
Unit no_1.pptx
Unit no_1.pptx
Ganeshpatil499846
 
Programming C ppt for learning foundations
Programming C ppt for learning foundations
ssuser65733f
 
C programming for Computing Techniques
C programming for Computing Techniques
Appili Vamsi Krishna
 
Coding - SDLC Model
Coding - SDLC Model
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
Unit 1 program development cycle
Unit 1 program development cycle
Dhana malar
 
Introduction.pptx
Introduction.pptx
ssusera8c91a
 
FDS Unit I_PPT.pptx
FDS Unit I_PPT.pptx
sayalishivarkar1
 
Ch1 principles of software development
Ch1 principles of software development
Hattori Sidek
 
L1
L1
AMR ELMAGHARAY
 
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
Nguyễn Nho Vĩnh
 
Programming in C - Problem Solving using C
Programming in C - Problem Solving using C
PoovizhiP1
 
10 lesson8
10 lesson8
Mary Grace Uminga
 
Chapter 2(1)
Chapter 2(1)
TejaswiB4
 
C++ programming program design including data structures
C++ programming program design including data structures
Ahmad Idrees
 
3 Program Development Life Cycle.aaaaapptx
3 Program Development Life Cycle.aaaaapptx
EG20910848921ISAACDU
 
01SoftwEng.pptInnovation technology pptInnovation technology ppt
01SoftwEng.pptInnovation technology pptInnovation technology ppt
sultanahimed3
 
Introduction to Computer Programming
Introduction to Computer Programming
Prof. Erwin Globio
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai1
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai
 
Programming C ppt for learning foundations
Programming C ppt for learning foundations
ssuser65733f
 
C programming for Computing Techniques
C programming for Computing Techniques
Appili Vamsi Krishna
 
Unit 1 program development cycle
Unit 1 program development cycle
Dhana malar
 
Ch1 principles of software development
Ch1 principles of software development
Hattori Sidek
 
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
Nguyễn Nho Vĩnh
 
Programming in C - Problem Solving using C
Programming in C - Problem Solving using C
PoovizhiP1
 
Chapter 2(1)
Chapter 2(1)
TejaswiB4
 
C++ programming program design including data structures
C++ programming program design including data structures
Ahmad Idrees
 
3 Program Development Life Cycle.aaaaapptx
3 Program Development Life Cycle.aaaaapptx
EG20910848921ISAACDU
 
01SoftwEng.pptInnovation technology pptInnovation technology ppt
01SoftwEng.pptInnovation technology pptInnovation technology ppt
sultanahimed3
 
Ad

More from Frankie Jones (14)

Dbm2013 engineering mathematics 3 june 2017
Dbm2013 engineering mathematics 3 june 2017
Frankie Jones
 
Basic concepts of information technology and the internet
Basic concepts of information technology and the internet
Frankie Jones
 
2.1 Understand problem solving concept
2.1 Understand problem solving concept
Frankie Jones
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem
Frankie Jones
 
Introduction to programming principles languages
Introduction to programming principles languages
Frankie Jones
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Frankie Jones
 
Chapter 3 Computer Organization
Chapter 3 Computer Organization
Frankie Jones
 
Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)
Frankie Jones
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)
Frankie Jones
 
Chapter 1 computer hardware and flow of information
Chapter 1 computer hardware and flow of information
Frankie Jones
 
Operator precedence
Operator precedence
Frankie Jones
 
Type header file in c++ and its function
Type header file in c++ and its function
Frankie Jones
 
Multimedia storyboard template
Multimedia storyboard template
Frankie Jones
 
Occupancy calculation form
Occupancy calculation form
Frankie Jones
 
Dbm2013 engineering mathematics 3 june 2017
Dbm2013 engineering mathematics 3 june 2017
Frankie Jones
 
Basic concepts of information technology and the internet
Basic concepts of information technology and the internet
Frankie Jones
 
2.1 Understand problem solving concept
2.1 Understand problem solving concept
Frankie Jones
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem
Frankie Jones
 
Introduction to programming principles languages
Introduction to programming principles languages
Frankie Jones
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Frankie Jones
 
Chapter 3 Computer Organization
Chapter 3 Computer Organization
Frankie Jones
 
Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)
Frankie Jones
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)
Frankie Jones
 
Chapter 1 computer hardware and flow of information
Chapter 1 computer hardware and flow of information
Frankie Jones
 
Type header file in c++ and its function
Type header file in c++ and its function
Frankie Jones
 
Multimedia storyboard template
Multimedia storyboard template
Frankie Jones
 
Occupancy calculation form
Occupancy calculation form
Frankie Jones
 
Ad

Recently uploaded (20)

UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 

2.2 Demonstrate the understanding of Programming Life Cycle

  • 2. WEEK 5 CLO 1 Explain the basic computer and programming fundamentals with appropriate examples of language and technology
  • 3. -Specify the Problem -Analyze the problem -Design the algorithm to solve the problem -Implement the algorithm -Test and verify the completed program -Maintain and update the program -Documentation Programming Life Cycle • There are 7 phases in programming Life Cycle:
  • 4. Specify the Problem Problem Statement Compute and display the total cost apples given the number of kilograms of apples purchased and the cost per kilogram of apples. Compute and display the total price apples given the weight in kilograms of apples purchased and the price per kilogram of apples.
  • 5. Specify the Problem • The first step in solving any problem is to understand it. • Read the requirements statement carefully. • State the problem clearly and unambiguously. • Gain clear understanding of what is required for its solution.
  • 6. Specify the Problem • In problem requirement phase you may ask some question like a. What to compute? b. What unit do they use? c. Is it only for the apple or other fruit? or any question for gaining understanding of what is required.
  • 7. Analyze the problem • Identify the problem inputs you have to work with and also the problems outputs (results) desired. • Check any additional requirements or constraints on the solution. • Determine the required format of the results to be displayed. • Develop a list of variables.
  • 8. Analyze the problem • To analyze the problem you may summarize the information contained in it and find out the problem input and output. Problem Inputs a. weight in kilogram b. price per kilogram ( in RM per kg) Problem Output a. Total price (in RM)
  • 9. Analyze the problem • Develop a list of formulas that specify relationships between the inputs and the outputs: Total price = price per kilogram x weight in kilogram .
  • 10. Analyze the problem • Find a list of solution alternatives Ex: 1. Define price per kilogram as constant and weight in kilogram as input value 2. Define price per kilogram and weight in kilogram as input values
  • 11. Analyze the problem • All the information gained from analyzing the problem can be put into problem Analysis chart (PAC) Given Data Required Results Weight in kilogram Price per kilogram Total price Processing Required Solution Alternatives Total price = price per kilogram x weight in kilogram 1. Define price per kilogram as constant and weight in kilogram as input value *2. Define price per kilogram and weight in kilogram as input values
  • 12. Design the algorithm to solve the problem • Once you fully understand the problem and have clarified any questions you have, you need to develop your solution. • Algorithm is a set of instructions for the computer • Setting up the algorithms is probably the hardest part of problem solving on the computer
  • 13. Design the algorithm to solve the problem • The instructions cannot assume anything, cannot skip steps, must be executable one step at a time and must be complete • Example of algorithm: 1. Input the weight in kilograms of apples purchased and the price per kilogram of apples 2. Calculate total price apples using the formula: Total price = price per kilogram x weight in kilogram 3. Print Total Price
  • 14. Design the algorithm to solve the problem • Tools which can be used to help you in this task: a) Structure Chart b) IPO chart c) flowchart d) pseudocode
  • 15. Design the algorithm to solve the problem a) Structure Chart • Depict the overall organization of a program, show how program segment or modules are defined and how they relate to one another. • The module in the upper row serve as control functions directing the program to process modules under them as appropriate. • It follows a top-down design philosophy.
  • 16. Design the algorithm to solve the problem a) Example : Structure Chart TOTAL PRICE CONTROL MODULE 0000 READ 1000 CALC 2000 PRINT 3000
  • 17. Design the algorithm to solve the problem b) IPO (Input-Processing-Output) chart - shows in more detail what data items are input, what processing takes place on that data and what information will be the end result, the output
  • 18. Design the algorithm to solve the problem b) Example : IPO (Input-Processing-Output) chart Input processing Module reference number Output Weight in kilogram Price per kilogram 1. Enter Weight in kilogram 2. Enter Price per kilogram 3. Calculate Total price 4. Print Total price 5. End 1000 1000 2000 3000 0000 Total price
  • 19. Design the algorithm to solve the problem c) flowchart - graphic representations of the algorithm - shows the flow of processing from the beginning to the end of a solution - each block in a flowchart represents one instruction from an algorithm - flow lines indicate the direction of the data flow
  • 20. Design the algorithm to solve the problem start Input WeightInKg, PricePerKg TotalPrice = WeightInKg * PricePerKg Print TotalPrice end c) Example : flow chart
  • 21. Design the algorithm to solve the problem d) pseudo code • Uses English like statements in place of the flowchart graphical symbols. • It is easier to code a program from it than from flowchart. • It is not tied to any programming language. • It is easy to modify but not graphical, difficult to use for logically complex problems, and slower to create.
  • 22. Design the algorithm to solve the problem d) Example : pseudo code START Input WeightInKg, PricePerKg TotalPrice = WeightInKg * PricePerKg Print TotalPrice END
  • 23. Implement the algorithm • This step involves writing the algorithm as a program. • By using flow chart as the guideline, start writing a program from the top of flow chart and work your way to the bottom.
  • 24. Implement the algorithm • Example of program code in C++ #include <iostream.h> int main() { float WeightInKg, PricePerKg, TotalPrice; cout<<“ Enter weigh in Kg: “; cin>> WeightInKg; cout<<“ Enter price per kg: “; cin>> PricePerKg; TotalPrice= WeightInKg * PricePerKg; cout<<“ Price of apples : RM “<<TotalPrice; return 0; }
  • 25. Test and verify the completed program • After writing the program, you must test it. • Program testing can be a very tedious and time consuming. • Run the program several times using the different sets of data. • Make sure that it works correctly for every situation provided in the algorithm. • Example: Blackbox Testing or Whitebox testing.
  • 26. Test and verify the completed program • Blackbox testing gets its name from the concept of testing the program without knowing what is inside- without knowing how its works. By a user. • Whitebox testing assumes that the tester knows everything about the program. It is a programmer’s responsibility.
  • 27. Test and verify the completed program • Errors are so common that they have a special name (BUGS). Bugs must be identified and corrected. • The process of identifying and correcting bugs is known as debugging. • When the compiler detects an error, the computer will display an error message, which indicates that you have made a mistake and what the cause of the error might be.
  • 28. Test and verify the completed program • Types of error in programming - Syntax Error / Compiler Error - Run-Time Error - Logical Error
  • 29. Test and verify the completed program • Syntax Error (Compilation Error) – An error in the format of a statement in a computer program that violates the rules of the programming language employed. – A program will not be executed until all syntax errors are corrected – Error can be traced at the event of compilation
  • 30. Test and verify the completed program • Run –time error – Are detected by the computer and are displayed during execution of a program. – A run-time error occurs when the program directs the computer to perform an illegal operation, such as dividing a number by zero or
  • 31. Test and verify the completed program • Logical Error – The hardest errors to find and fix. – A logic error means although the language syntax was used correctly, there was a misunderstanding: if you want a, where b=c+a and you give a = b-a instead of a = b-c, then you will get the wrong answer, but have used the correct language syntax.
  • 32. Maintain and Update the program • Maintenance and update are the modification of a software product after delivery to correct faults, to improve performance or other attributes, or to adapt the product to a modified environment.
  • 33. Maintain and Update the program • Types of maintenance a) Corrective maintenance - Reactive modification of a software product performed after delivery to correct discovered problems. It deals with fixing bugs in the code. b) Adaptive maintenance -Modification of a software product performed after delivery to keep a software product usable in a changed or changing environment. It deals with adapting the software to new environments.
  • 34. Maintain and Update the program • Types of maintenance a) Perfective maintenance -Modification of a software product after delivery to improve performance or maintainability. It deals with updating the software according to changes in user requirements. b) Preventive maintenance -Modification of a software product after delivery to detect and correct latent faults in the software product before they become effective faults. It deals with updating documentation and making the software more maintainable.
  • 35. Documentation • documentation should be concise so the person who reads it doesn't have to spend too much time to find what he or she is looking for. • There are two types of documentation a) internal documentation - The comments you put in your source code files should be written to help other programmers navigate through your code easily in order to find bugs or to determine where to add new features.
  • 36. Documentation • There are two types of documentation b) external documentation -is made up of the manuals written about the solution -is written text that accompanies computer software. It either explains how it operates or how to use it, and may mean different things to people in different roles.