23
Structured Programming (4 Credits) HNDIT11034

Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Embed Size (px)

Citation preview

Page 1: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Structured Programming (4 Credits)

HNDIT11034

Page 2: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Module Aims & objectivesEnhance skills for the

development of application programmes through systematic problem solving skills

Page 3: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Learning OutcomesApply systematic approach to

problem solvingUse appropriate data types for

representation of data within a programme

Use appropriate control structures for defining logical instruction flow

Demonstrate basic programme testing skills inclusive of debugging and tracing.

Page 4: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Assessment and Weighting

• Continuous Assessment Tutorials and lab assignments related to classroom teaching - 25%

• Mini programming project 25%

• End of semester examination Structured written paper 50%

Page 5: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Week 1 – Learning OutcomesDefine a computer programExplain what is programmingDescribe the importance of

programs and programmingDescribe the evolution of

programmingDesign an algorithmic solution for

simple problem such as computation of a factorial, total of a series etc. using flow charts

Page 6: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

• A computer program is a set of instructions or commands, which tell the computer what to do.

• A computer language is a set of symbols and rules used in constructing programs.

• Computer languages are used to develop application programs

Introduction

Page 7: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

7

Program Development Life Cycle

Six main phases1. Define the problem2. Design the solution3. Code the program4. Test the program5. Document the program6. Implement the program

Page 8: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Source Code Object CodeTranslator

Page 9: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Low Level Language

High Level Language

1st Generation

2nd Generation

3rd Generation

4th Generation

5th Generation

Computer Language

Page 10: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

• First and second generation languages are considered low level languages.

• They are machine dependant languages

• These languages are close to the hardware

• The programmer should have hardware knowledge to write a program

• Productivity is low

Low Level Languages

Page 11: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

High Level Languages

• 3GL,4GL and 5GL are considered high level languages

• They are machine independent languages

• It is easy to write and modify • The programmer does not need

knowledge of hardware to write programs

• Productivity is high• Consume less time to write

programs• Translators need to be used to

convert to machine language

Page 12: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

12

Design the Solution

Design an algorithm. An algorithm is a finite series of logical

steps required to solve a particular problem. Finite means that the beginning and end are

clearly defined.

Page 13: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

13

Flowcharting

A flowchart is a pictorial representation of an algorithm or logical steps.

Each step is represented by a symbol and the arrows indicate the flow and order of the steps.

The shape of the symbol indicates the type of operation that is to occur.

Page 14: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

14

Basic Flowchart Symbols

Begin or End Input or Output

Processing Decision

Branch or Direction of Flow

Page 15: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

15

Flow Control Structures

Flow control is the order in which statements are executed.

There are four control structures. 1. Sequence Control 2. Selection Control

Also referred to as branching (if and if-else)

3. Repetition Control (loops)

Page 16: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

16

Sequence Control

Page 17: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

17

Selection Control (branching)

Page 18: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

18

Repetition Control (loops)

Page 19: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Flowchart for ProcessingCredit Orders

Entersalesorder

Approvedfor credit?

Rejectorder

Inventoryavailable?

Back-order

Fill order Stop

Start

No

Yes

Yes

No

Page 20: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Draw a flow chart to cross the road.

Are clear both

ways?

Go to pavement

No

Cross the road Wait

Yes

Start

Stop

Look at left & right

Page 21: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Draw a flow chart to find the correct key from a bunch keys to open the door.

Can the door be opened

Tryout a key

No

Try the next key

Yes

Start

Stop

Page 22: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

DiscussionHow to apply flowchart to design

solution for a computational problems. (Discuss few from the lab sheet)

Page 23: Structured Programming (4 Credits) HNDIT11034. Module Aims & objectives Enhance skills for the development of application programmes through systematic

Q & A