0% found this document useful (0 votes)
39 views

Module 1 - Ch3 - Programming Methodologies, Approaches and Design Tools

OOP with Java

Uploaded by

jhesorleylaid
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Module 1 - Ch3 - Programming Methodologies, Approaches and Design Tools

OOP with Java

Uploaded by

jhesorleylaid
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

MODULE 1

ESSENTIAL CONCEPTS OF COMPUTER


SYSTEMS AND PROGRAMMING
CHAPTER 3
Programming Methodologies, Approaches and
Design Tools
What is Programming?
• It is the art of problem solving.

• The process of writing software in


a specific programming language
to meet systems requirements
specification.

1. Essential Concepts of Computer Systems and Programming


What is Programming?
• Involves program coding, or
writing instructions in accordance
with the rules of a chosen
programming language

1. Essential Concepts of Computer Systems and Programming


Programming Methodologies and
Approaches
• Structural or Procedural
Breaks down a complex problem into
modules or procedures (decomposition)
Uses top-down and/or bottom-up approach
• Object – Oriented
Objects are defined to accomplish a task
Objects are things, people, entities that
are naturally part of the program. OO
makes software presentations these
entities
1. Essential Concepts of Computer Systems and Programming
Programming Methodologies and
Approaches

PROCEDURAL /
STRUCTURED
• Simple, easy implementation of compilers
and interpreters
• The ability to re-use the same code at
different places in the program without
copying it
• An easier way to keep track of program flow
• The ability to be strongly modular or
structured
• Needs only less memory
1. Essential Concepts of Computer Systems and Programming
Programming Methodologies and
Approaches

PROCEDURAL
/STRUCTURED
• Programs are more easily and more quickly
written
• Programs are reliable as fewer
organizational logical errors occur during
the initial stages of program development

1. Essential Concepts of Computer Systems and Programming


Programming Methodologies and
Approaches

OBJECT ORIENTED
• Improved software development
productivity due to modularity, extensibility
and reusability
• Software maintenance is improved
• Reusability helps in faster development of
programs, as the language comes worth
rich library of objects
• Lower cost of development
• Higher quality of software can be ensured
1. Essential Concepts of Computer Systems and Programming
Student Registration System

Description
• The Student Registration System is a system
that screens and enrolls students for
admission to a particular course.
Objectives
• The system should be able to
- Accept and screen student applications
- Assess his/her qualifications
- If qualified, accept the student’s payment and
enroll the student in the course.
1. Essential Concepts of Computer Systems and Programming
Student Registration System

System Design
• Using a Structured Approach- Top-Down Methodology

1. Essential Concepts of Computer Systems and Programming


Student Registration System
• Using a Object Oriented methodology, the
following objects were identified

1. Essential Concepts of Computer Systems and Programming


Program Development Life Cycle
● When developing a program using
any programming language, follow a
sequence of steps.
● These steps are called phases in
program development.
● The program development life cycle
is a set of steps or phases that are
used to develop a program in any
programming language
1. Essential Concepts of Computer Systems and Programming
Program Development Life Cycle
Problem
Definition

Problem
Maintenance
Analysis

Testing and Algorithm


Debugging Development

Coding and
Documentation

1. Essential Concepts of Computer Systems and Programming


Program Development Life Cycle
• Problem Definition
- Define problem statement and decide
problem boundaries
- Understand problem statement,
requirements, required output
• Problem Analysis
- Determine and gather required resource to
solve the problem

1. Essential Concepts of Computer Systems and Programming


Program Development Life Cycle
• Algorithm Development
- Develop step by step procedure(s) using
the given specification
• Coding and Documentation
- Uses a programming language to write or
implement actual programming instructions
(C, C++, Java, C#, etc.)

1. Essential Concepts of Computer Systems and Programming


Program Development Life Cycle
• Testing and Debugging
- Test the program whether it is solving the
problem for various input data or not
- Test whether it is providing the desired
output or not
• Maintenance
- Problems encountered need enhancements

1. Essential Concepts of Computer Systems and Programming


Programming Design Tools
At the programming level, the
following tools help in designing
programs:
• Narratives
• Flowchart
• Pseudocode
• HIPO Chart

1. Essential Concepts of Computer Systems and Programming


Program Development Tools

Narratives
• Program logic is described and
communicated through the use of
words
• Procedures / steps maybe narrated via
complete sentences or phrases-
maybe numbered

1. Essential Concepts of Computer Systems and Programming


Program Development Tools

Narratives – Sample Problem


A deck of 10 cards contains numbers
ranging from 0 to 9, where 0 indicates the
end of file. Calculate and print the
average of the sum of squares

1. Essential Concepts of Computer Systems and Programming


Program Development Tools

Narratives – Sample Problem


Solution
Step 1: Set COUNTER to 1.
Step 2: Set SUM_SQUARES to 0.
Step 3: Read a card (containing a NUMBER)
Step 4: If NUMBER = 0, then go to step 9.
Step 5: Square the NUMBER.
Step 6: Accumulate the sum of the squared number,
i.e., add the squared number to SUM_SQUARES.
1. Essential Concepts of Computer Systems and Programming
Program Development Tools

Narratives – Sample Problem Solution


Step 7: Increment COUNTER, i.e. add 1 to COUNTER
Step 8: Go to Step 3.
Step 9: Compute the average of the sum of squares,
i.e. divide SUM_SQUARES by COUNTER and store in
AVERAGE
Step 10: Print AVERAGE
Step 11: End the program.

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Flowchart
• Used to graphically present the
solution to a problem. It uses
flowcharting symbols linked together
in a “flow” that will arrive at the
solution

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Flowchart
• Among the tools it is the easiest to
understand because of it is visual
appeal. However, the chart can get
very cluttered and disorganized when
working on complex problems

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Flowchart

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Flowchart

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Flowchart

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Flowchart
Create a flowchart
that show the profit
or losses based on
the given income
and cost.

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Pseudocode
• Describes the logical flow of the
solution to the problem through
English-like code that closely
resembles the actual programming
language to be used.

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Pseudocode
• There are no rigid syntax rules in
pseudocode. More emphasis is placed
in the logic of the solution rather than
the syntax of the language

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Pseudocode

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Pseudocode

1. Essential Concepts of Computer Systems and Programming


Program Development Tools
Pseudocode

1. Essential Concepts of Computer Systems and Programming


Program Development Tools

Hierarchical Input-Process-
Output (HIPO)
• A tool used for problem definition and
problem analysis
• Help clarify ambiguous portions of the
specifications

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
To derive a HIPO Chart, questions such
as these may be asked:
1. What are the outputs required?
2. What are the inputs needed to
produce the outputs?
3. What are the processes needed to
transform the inputs to the desired
outputs?
1. Essential Concepts of Computer Systems and Programming
Program Development Tools -
HIPO
Simple adding problem
Given 2 numbers, print the sum of
the 2 numbers.
1. Define the outputs needed
INPUT PROCESS OUTPUT

Sum of First and


Second Number

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
2. What inputs are provided? What other
inputs are needed to produce the output?

INPUT PROCESS OUTPUT

1st and 2nd Sum of First and


Number Second Number

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
3. What processes are needed to transform
the inputs to the desired output?

INPUT PROCESS OUTPUT


1. Get 1st Number Sum of 1st
1st and 2nd 2. Add 2nd Number and 2nd
Number to the 1st Number Number
3. Print out the sum
of the two
numbers

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
Guidelines in developing the HIPO
• Output should be determined first before
inputs or processes. This establishes the
objective and scope of the solution. Limit
the output to those that are required in the
specifications.
• Output are easy to identify because they
usually follow verbs like “print”, “display”
or “generate”.
1. Essential Concepts of Computer Systems and Programming
Program Development Tools -
HIPO
Guidelines in developing the HIPO
• Inputs are also given in specifications. In
simple problems, the inputs clearly lead to
outputs. In complex problems, this may not
be visible outright, but on further
refinement of the solution.

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
Guidelines in developing the HIPO
• Processes contain the action taken to
transform the inputs to outputs. This can be
stated in English and do not have to
conform to any programming language.
• Actions on processes are executed
sequentially, e.g. from top to bottom.
Numbering the steps signify the order of
execution
1. Essential Concepts of Computer Systems and Programming
Program Development Tools -
HIPO
Problem:
Given 3 whole numbers, print out
the average of the 3 numbers.

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
Problem Definition:
1. Is the problem clear?
2. Are the outputs clearly defined?

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
Problem Analysis using HIPO
LEVEL 0 – Main HIPO

INPUT PROCESS OUTPUT


1st Number 1. Compute the sum of
Average of 3
2nd Number the three numbers
2. Compute the average numbers
3rd Number
based on the sum
3. Print the average

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
LEVEL 1 – HIPO
Process 1 – Compute the sum of 3 numbers

P1 - INPUT PROCESS 1 P1 - OUTPUT


1st Number 1.1 Get the 1st Number
Sum 3
2nd Number 1.2 Get the 2nd Number &
add to the 1st number numbers
3rd Number
1.3 Get the 3rd number &
add to the sum in P1.2

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
LEVEL 1 – HIPO
Process 2 – Compute the average based on sum

P2 - INPUT PROCESS 2 P2 - OUTPUT


2.1 Divide the sum by 3
Sum of 3 Average of 3
Numbers numbers

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
LEVEL 1 – HIPO
Process 3 – Print the average

P3 - INPUT PROCESS 3 P3 - OUTPUT


3.1 Print the average Printed
Average of 3 Average of 3
Numbers numbers

1. Essential Concepts of Computer Systems and Programming


Program Development Tools -
HIPO
THE HIPO PROCESS
SUMMARY Main

INPUT P1 – Compute the sum OUTPUT


1st Number, Printed
2nd Number, P2 – Compute the Average of 3
3rd Number average numbers

P3 – Print the average

1. Essential Concepts of Computer Systems and Programming


Sources
● https://www.javatpoint.com/procedural-programming-vs-object-oriented-progra
mming
● https://www.tutorialspoint.com/programming_methodologies/programming_met
hodologies_flowchart_elements.htm
● https://www.visual-paradigm.com/tutorials/flowchart-tutorial/
● https://easycodebook.com/2020/04/flowcharts-with-examples-and-explanation-
of-symbols/
● https://www.code4example.com/pseudocode/pseudocode-examples/
● http://www.flowgorithm.org/documentation/index.html
● https://www.testingdocs.com/hipo-chart/

Next Chapter: Java Programming and OOP Concepts

1. Essential Concepts of Computer Systems and Programming

You might also like