Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
My Basket
Notes -Notions & Basics of electrical engineering£6.25
introduction to networks£3.44
Semiconductor diode Analog Electronic Diploma £1.50
Software £12.50
PLC Programming for Industrial Automation£1.25
HNC HND in Mechanical Electrical Electronic Engineering Unit 1 - Analytical Methods for Engineers£2.50
role of BME in hospital management - summary£10.00
Programming Embedded System I£6.25
Presentation skills£1.50
Simplified physics£12.50
HYDRAULIC PUMPS£1.50
Operations on complex numbers in algebraic form£4.38
Implicit functions and their differentiation£2.00
Decomposition of fractional rational function (Mathematics)£2.00
emft notes£62.50
Introductory Electricity, Magnetism and Mordern Physics£12.50
4 MVA and 2MVA distribution transformer wiring diagram £18.75
Project of Mechanical engineering£0.50
Modern Physics.£3.75
HNC HND in Mechanical Electrical Electronic Engineering Unit 1 - Analytical Methods for Engineers£2.50
Direct integrating £3.13
Types of Motor Loads£2.75
Basic Electrical Engineering£7.50
Basic electrical engineering £6.25
induction motor£38.13
DATA STRUCTURE & ALGORITHM £0.50
mining notes£1.51
Total£227.82
Description: The notes provides greater understanding on ways to design a program.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
PROGRAM DESIGN
Developing a computer program involves devising a solution to a problem
...
e
...
The longer an error goes undetected the more costly it is to correct hence
early stages of program design are very important
...
Reliability: - The program can be depended upon always to do what it is supposed to do
ii)
...
Readability: - The program will be easy for the program to read and understand
iv)
...
v)
...
Storage saving: - The program is not allowed to be necessarily long
PROGRAM DEVELOPMENT CYCLE (STAGES IN PROGRAMMING)
The following are stages necessary for producing a program
...
Identifying the Problem (Requirement Specification)
ii)
...
Developing the Outline into an Algorithm
iv)
...
Testing and Debugging
vi)
...
A good specification will usually specify what processing is needed by giving the exact
relationship between the outputs and inputs from which there are derived rather than prescribing how the
program should be written
ii)
Outline the Solution
This is where the programmer may decide to break the problem into smaller tasks or steps
...
iii) Develop the Outline into an Algorithm (Algorithm Design)
This is where the outline developed in step two is expanded into a set of precise steps which describes
exactly the tasks to be performed under the order in which they are to be carried out
...
If logical errors are detected the are easily corrected
v)
Translate the Design into a Program: -This step involves translating the algorithm into a program
using an appropriate programming language
vi) Testing and Debugging
Debugging is the detection and correction of errors that may exists in the program
...
Careful design in the early stages of the programming will help to minimize these
errors
vii) Documentation and Maintenance of the Program
Documentation involves external documentation such as hierarchy charts, the algorithm and test data
reports
...
Program Maintenance involves changes that may be made in a program
...
Decomposition involves the use of the following approaches (strategies):
i)
Top-Down Design
In this approach, an overview of the system is formulated, without going into detail for any part of it
...
Each new part may then be refined again,
defining it in yet more details until the entire specification is detailed enough to validate the model
...
ii)
Bottom-up Design
Bottom-up design, in contrast to the top down design, is one of the software design strategies in which
individual parts of the system are specified in detail
...
ALGORITHM DESIGN
An algorithm is a step-by step procedure to be followed in order to obtain a solution to a problem
...
Must be clear, precise and unambiguous
...
The following are algorithms design tools
...
Flowcharts
ii)
...
Flowchart
This refers to the graphical representation of an algorithm or a portion of it
...
Flowcharts are made up of boxes of standard shapes linked to show the order of processing
...
The following are the standard set of symbols used to draw flowcharts
i)
...
Process
Process
...
Details
are written in the rectangular box
...
Input/output
Input and output operations are
shown in the parallelogram
...
Decision
...
Decisions
v)
...
A
Using Flowcharts to represent Control structures
...
The following
represents the three control structures using flowchart
a)
Sequence:
A
B
Statement(s) -A
Statement(s) -B
Statement(s) -C
...
True
True
Condition
Task(s) B
Task(s) A
ii)
If condition is true
Task statement(s) A
Else
Task statement(s)
False
Single selection
...
A value is input from the keyboard
...
Solution
Start
Input Number
True
True
Print Negative
False
True
Number < 0
True
True
Number > 0
Print Positive
False
True
Print Zero
End
Selection (Using Case Structure
...
A preferable solution is the use of the case structure as shown below
Condition
1=True
True
Task(s) A
Programming Notes ~ Wainaina
2=True
True
Task(s) B
3=True
True
Task(s) C
Page 6 of 8
Case of condition
Case 1:
Task statement(s) A
Case 2:
Task statement(s) B
Case 3:
Task statement(s) C
………
………
End case
The advantage of flowchart is that the patterns of logic are easy to form
...
e
...
ii)
...
It’s a non-executable program code used as an aid to develop and document structured programs
...
Process in pseudo code is
expressed as a combination of sequence of events, decisions that need to be implemented and actions that may
be repeated
...
ii)
It only allows the three control structures of sequence, selection and iteration, i
...
the technique does not
permit the use of goto statements and their associated labels
iii)
Many languages such as PASCAL have syntax that is almost identical to pseudo code and makes the
transition from design to coding extremely easy
Rules for writing pseudocode
...
Simple English should be used to write the statements
...
Every English statement or instruction should be on its one line i
...
separate line
...
Indention of the statements should be done appropriately
...
4
...
5
...
Example
Develop a pseudocode algorithm for a program that accepts each of the average marks of 10 students in a class
and computes the sum and the average mark of the class
...
Begin
Set total to zero
Set counter to one
While counter is less than or equal to ten
Input student average mark
Add average mark to total
Add one to the counter
Set the class average to total divided by ten
Display the class average
End
Programming Notes ~ Wainaina
Page 7 of 8
Counter
Mark
Total
Class average
1
70
0
2
65
70
3
75
135
4
50
210
5
40
260
6
300
60
Exercise
Develop a pseudocode algorithm for a program that accepts each of the average marks of students in a class and
computes the sum and the average mark of the class
...
Desk Checking
...
It follows the following six simple
steps
...
Two or three test cases are usually efficient
...
iii) Make a table of the relevant variable names within the algorithm on the paper
...
v) Repeat step four using other test data cases until the algorithm has reached the end
...
Programming Notes ~ Wainaina
Page 8 of 8
Description: The notes provides greater understanding on ways to design a program.