CIT304 Chapter 1 Y24

You might also like

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

C# Programming (CSC 304)

Structured Programming

Adedoyin I. OYEBADE
sacnet2015@gmail.com

Bowen University,
Iwo, Nigeria

March 12, 2024

OYEBADE A. (BU) CSC 439 March 12, 2024 1 / 10


Presentation Overview

1 Introduction to Structured Programming


Definition of good program, structured and unstructured
Differences between structured and unstructured
Programming
Types of Structured Programming
Component of Structured Programming
Structured Programming Techniques
Step-wise Refinement

OYEBADE A. (BU) CSC 439 March 12, 2024 2 / 10


Definition: Good Program, Structured and
Unstructured

Definition
A good program is one that is clear, legible, accurate, efficient and
easily maintainable

Definition
Structured programming (sometimes known as modular
programming) is a programming paradigm that facilitates the
creation of programs with readable code and reusable
components.

Definition
Unstructured programming: The code is written as a single block

OYEBADE A. (BU) CSC 439 March 12, 2024 3 / 10


Differences between Structured and Unstructured
Programming
1 Structured Programming
• Structured Programming is a programming paradigm which
divides the code into modules or function.
• Structured Programming based programs are easy to read.
• Structured Programming is to make the code more efficient and
easier to understand.
• Structured Programming is easier because of modules.

2 Unstructured Programming
• Unstructured Programming is the paradigm in which the code is
considered as one single block.
• Unstructured Programming based programs are hard to read.
• Unstructured programming is just to program to solve the
problem. It does not create a logical structure.
• Unstructured programming is harder when comparing with the
structured programming.
OYEBADE A. (BU) CSC 439 March 12, 2024 4 / 10
Types of Structured Programming

1 Procedural Programming

2 Defines modules as ”procedures” or ”functions” that are called


with a set of parameters to perform a task. Types are
• Service-oriented programming

• Microservice programming

• Functional programming

OYEBADE A. (BU) CSC 439 March 12, 2024 5 / 10


Types of Structured Programming

1 Object-oriented programming
• Defines a program as a set of objects or resources to which
commands are sent. An object-oriented language will define a
data resource and send it to process commands.
2 Model-based Programming
• The most common example of this is database query languages.
In database programming, units of code are associated with
steps in database access and update or run when those steps
occur.

OYEBADE A. (BU) CSC 439 March 12, 2024 6 / 10


Component of Structured Programming

1 Components
• At high level, structured programs consist of a structural
hierarchy starting with the main process and decomposing
downward to lower levels as the logic dictates.
• lower structures are the modules of the program, and modules
may contain both calls to other (lower-level)
• Structured programs and modules typically have a header file or
section that describes the modules or libraries referenced and
the structure of the parameters and module interface.

OYEBADE A. (BU) CSC 439 March 12, 2024 7 / 10


Structured Programming Techniques

1 Modular programming
• a large programming task is sub-divided into smaller parts or
functions called program modules

2 Top-down design
• structures the program modules of modularization into
hierarchies
3 Structured coding
• consists of skillful use of only 3 control structures: Sequence,
Selection and Iteration

OYEBADE A. (BU) CSC 439 March 12, 2024 8 / 10


Structured Coding

1 Sequence
• Simply do one instruction then the next and the next. Just do
them in a given sequence or in order listed. Most lines of code
are this
2 Selection
• This is where you select or choose between two or more flows.
The choice is decided by asking some sort of question
3 Branching
• control structure that allows the flow of execution to jump to a
different part of the program
4 Iteration
• so known as repetition, it allows some code (one to many lines)
to be executed (or repeated) several time

OYEBADE A. (BU) CSC 439 March 12, 2024 9 / 10


Step-wise Refinement

1 Step-wise Refinement
• s the idea that software is developed by moving through the
levels of abstraction, beginning at higher levels and,
incrementally refining the software through each level of
abstraction, providing more detail at each increment.

OYEBADE A. (BU) CSC 439 March 12, 2024 10 / 10

You might also like