2. PROGRAMS AND PROGRAMMING
What is a program?
●
A list of instructions for the computer to follow to
accomplish a task of processing data into
information.
What is programming?
●
●
Also known as software development / software
development life cycle(SDLC)
A six step procedure for creating that a list of instructions
4. STEP 1 : PROGRAM SPECIFICATION
●
Also called program definition or program analysis
●
Requires: programmer and end user
●
Five tasks:
1- Program objectives : the first task is to clearly define the problem to
solve in the form of program objectives.
2-Desired output : focus on the desired output before considering the
required inputs.
3-Input data : once outputs are defined ,determine the necessary input
data and the source of the data.
4-Processing requirements : determine the steps necessary
(processing requirements) to use input to produce output.
5-Program specifications document : to record this step’s program
objectives ,outputs, inputs and processing requirements.
5. STEP 2 : PROGRAM
DESIGN
●
●
Plan a solution using structured
programming technique
These techniques consist:
1) Top down program design
●
●
●
●
To identify the program's processing
steps
Such steps are called program
modules
Each module are made up of logically
related program statements
Example time and biling report
6. 2)Pseudocode
An outline of the logic of the program
you will write
It is like doing summary of the program
before it is written
3)Flowcharts
These graphically present the detail sequence
of steps needed to solve a programming
problem
7. Logic Structures
●
●
●
The best way to link the various part of the flowcharts is by
combines three logic structures called concatenation
,selection and repetition.
In the concatenation structures-one program statements
follow another. There is no question of “yes” or “no” of the
decision suggesting other consequences.
The selection structures(IF-THEN-ELSE)- occurs when a
decision must be made.
8. ●
●
●
The repetition or loop structures describe a process that
may be repeated as long as a certain condition remains
true
The structures is called “loop” or “iteration” because the
program loops around again and again
The repetition structures has two variation DO UNTIL
and DO WHILE
10. STEP 3 : PROGRAM CODE
●
Writing the program is called CODING
11. ASPECTS OF WRITING A PROGRAM
1)GOOD PROGRAMS
●
●
Good programs are reliable ,detect obvious and common
errors and are well documented.
The best way to create good programs is to write
structured programs using the three basic logic structures
presented in steps 2.
12. 2)CODING
There are hundreds of different programming languages.
Two types are:
●
●
Content mark-up language-instruct a computer how to
process different types types of information. Example
HTML used to create web pages.
Programming language-instruct a computer to perform
specific operations. C++ is widely used programming
language.
13. STEP 4 : PROGRAM TEST
●
●
Debugging is a process of testing and
eliminating errors in a program
Syntax and logic are two types of
programming errors.
14. SYNTAX ERROR
●
A violation of the rules of the programming language
●
Example in C++, each statement must end with a semicolon(;)
LOGIC ERROR
●
●
Occur when the programmer uses an incorrect calculation or
leaves out a programming procedures
Example, failure to include calculation of overtime hours in a
payroll program in a logic error
15. TESTING PROCESS
Five methods for testing for syntax and logic error are
●
●
●
●
●
1)Desk checking(code review):careful reading of a printout of the program.
2)Manual testing :using a calculator and sample data to test for correct
programming logic.
3)Attempt a translation: running the program using a translator program to
identify syntax errors.
4)Testing sample data: running the program and testing the program for
logic errors using sample data.
5) Testing by users (beta testing): final step in which potential users try the
program and provide feedback.
16. STEP 5: PROGRAM DOCUMENTATION
●
●
Documentation consist of written description
and procedures about a program and how to
use it
Program documentation is carried on
throughout all the programming steps
17. People who use documentation
include:
Users
●
who need to know how to use the program
●
some organizations offer training courses
●
other expect users to learn from written documentation
Operators
●
who need to know how to execute the program and how to recognize
and correct errors
Programmers
●
●
who may need to update and maintain the program in the future
documentation could include text and program flowchart ,program
listings and sample outputs
18. STEP 6 : PROGRAM MAINTENANCE
●
Design to ensure that the program operates correctly, efficiently and
effectively
●
Two categories of maintenance activities are the following
●
1) Operations
-include locating and correcting errors, improving usability and
standardizing software.
2)Changing needs
-organizations change over time and their programs must change
with them
starts with core program functionality, then
expands until the customer is satisfied with the results.
-AGILE DEVELOPMENT
19. CASE and OOP
CASE
●
Computer-aided software engineering(CASE) tools provide
automation and assistance in program design ,coding and
testing.
OOP
●
●
●
●
Traditional systems development focuses on procedure to
complete a specific objective.
Object-oriented software development focuses less on
procedures and more on defining relationships between
previously defined procedures or objects.
Object-oriented programming (OOP)- a process by which a
program is divided into modules called objects
Each object contains both the data and processing operations
necessary to perform a task.
21. Programming languages have
levels or generations ranging
from low to high.
1.Lower-level languages are
closer to the 0s and 1s
language of computers.
2.Higher-level languages are
closer to the languages of
human.
22. Generation
Sample statement
First :
Machine languages
111100100111001111001111111
Second:
Assembly languages
ADD 210(8,13),02B(4,7)
Third:
High-level procedural languages
If (score> = 90)grade = ‘A’;
Fourth:
Task-oriented languages
SELECT client FROM dailyLog WHERE
serviceEnd > 17
Fifth:
Problems and constraints languages
Get patientDiagnosis from
patientSymptoms “sneezing”, “coughing”,
“aching”
24. Computer programmers create, test, and
troubleshoot programs.
They also update and repair existing programs
Requirements include a bachelor’s or specialized
two-year degree in computer science or
information systems.
Salary range is $51,500 to $88,000