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.

More Related Content

PDF
POLITEKNIK MALAYSIA
PPT
Konsep Dan Asas Pengaturcaraan
PPT
Asas sistem-komputer
PPTX
Bab 1 Asas Pengaturcaraan (MALAYSIA) G-Vecom
PPT
Bab 2 pemprosesan perkataan
PPTX
Pengenalan kepada pengaturcaraan komputer
PDF
Inovasi ICT dalam Pengajaran Pembelajaran
PPTX
BAB 4 Perisian operasi
POLITEKNIK MALAYSIA
Konsep Dan Asas Pengaturcaraan
Asas sistem-komputer
Bab 1 Asas Pengaturcaraan (MALAYSIA) G-Vecom
Bab 2 pemprosesan perkataan
Pengenalan kepada pengaturcaraan komputer
Inovasi ICT dalam Pengajaran Pembelajaran
BAB 4 Perisian operasi

What's hot (20)

PPTX
BAB 3 Perisian Aplikasi
PPTX
Pengenalan Perisian Komputer
DOC
Unit7 : pengarahan (kepimpinan)
DOCX
Pengukuhan, penilaian dan pentaksiran
DOC
KITAR HAYAT PEMBANGUNAN SISTEM (6 langkah proses pembangunan sistem )
PPTX
Algoritma
PPTX
Slot 1: Definisi & Sejarah Komputer
PPTX
Pengurusan pembelajaran (Bab 5)
DOCX
Akses dan ekuiti
DOCX
Komponen utama komputer
DOCX
Pjm 3107 gimnastik
DOCX
Komponen asas komputer
PPTX
Grafik dalam Multimedia
DOCX
Pengenalan globalisasi pendidikan
PPT
hamparan elektronik
PDF
Pengenalan kepada komputer
DOCX
Soalan pengukuhan
PPTX
TEORI KONSTRUKTIVISME
PPTX
Kurikulum malaysia vs singapura
PPTX
Kod etika-pemakaian-profesion-perguruan
BAB 3 Perisian Aplikasi
Pengenalan Perisian Komputer
Unit7 : pengarahan (kepimpinan)
Pengukuhan, penilaian dan pentaksiran
KITAR HAYAT PEMBANGUNAN SISTEM (6 langkah proses pembangunan sistem )
Algoritma
Slot 1: Definisi & Sejarah Komputer
Pengurusan pembelajaran (Bab 5)
Akses dan ekuiti
Komponen utama komputer
Pjm 3107 gimnastik
Komponen asas komputer
Grafik dalam Multimedia
Pengenalan globalisasi pendidikan
hamparan elektronik
Pengenalan kepada komputer
Soalan pengukuhan
TEORI KONSTRUKTIVISME
Kurikulum malaysia vs singapura
Kod etika-pemakaian-profesion-perguruan
Ad

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

PPT
C programming for Computing Techniques
PPT
Programs_Problem_Solving_Algorithms.ppt
PPT
part_1 (1).ppt
PPTX
c++ approach of using object oriented programming
PDF
L1. Basic Programming Concepts.pdf
PDF
Algorithm.pdf
PPT
Unit 1 python (2021 r)
PDF
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
PPT
CHAPTER-1.ppt
PPTX
01 Introduction to analysis of Algorithms.pptx
PPTX
Module 1 python.pptx
PDF
Algorithmic problem sloving
PPTX
introduction to problem solving and programming
PPTX
Programming_Lecture_1.pptx
PPT
01CHAP_1.PPT
PDF
Problem Solving Techniques and Introduction to C
PPTX
Data Structures_Introduction to algorithms.pptx
PPT
Programming Fundamentals - Lecture 1.ppt
DOCX
Chapter 2(1)
DOCX
Lecture1
C programming for Computing Techniques
Programs_Problem_Solving_Algorithms.ppt
part_1 (1).ppt
c++ approach of using object oriented programming
L1. Basic Programming Concepts.pdf
Algorithm.pdf
Unit 1 python (2021 r)
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
CHAPTER-1.ppt
01 Introduction to analysis of Algorithms.pptx
Module 1 python.pptx
Algorithmic problem sloving
introduction to problem solving and programming
Programming_Lecture_1.pptx
01CHAP_1.PPT
Problem Solving Techniques and Introduction to C
Data Structures_Introduction to algorithms.pptx
Programming Fundamentals - Lecture 1.ppt
Chapter 2(1)
Lecture1
Ad

More from Frankie Jones (14)

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

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
KodekX | Application Modernization Development
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
A Presentation on Artificial Intelligence
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Modernizing your data center with Dell and AMD
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Monthly Chronicles - July 2025
KodekX | Application Modernization Development
Review of recent advances in non-invasive hemoglobin estimation
A Presentation on Artificial Intelligence
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Modernizing your data center with Dell and AMD
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

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.