programming and languages (chapter 14)

25
Chapter 14 : PROGRAMMING AND LANGUAGES Iostreamteam

description

slide show about programming and language.. enjoy !!

Transcript of programming and languages (chapter 14)

Page 1: programming and languages (chapter 14)

Chapter 14 :PROGRAMMING AND LANGUAGES

Iostreamteam

Page 2: programming and languages (chapter 14)

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

Page 3: programming and languages (chapter 14)

The six steps are as follows:

Page 4: programming and languages (chapter 14)

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.

Page 5: programming and languages (chapter 14)

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

Page 6: programming and languages (chapter 14)

2)PseudocodeAn outline of the logic of the program you will writeIt is like doing summary of the program before it is written

3)FlowchartsThese graphically present the detail sequence of steps needed to solve a

programming problem

Page 7: programming and languages (chapter 14)

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.

Page 8: programming and languages (chapter 14)

● 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

Page 9: programming and languages (chapter 14)

LOGIC STRUCTURES

Page 10: programming and languages (chapter 14)

STEP 3 : PROGRAM CODE

● Writing the program is called CODING

Page 11: programming and languages (chapter 14)

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.

Page 12: programming and languages (chapter 14)

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.

Page 13: programming and languages (chapter 14)

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.

Page 14: programming and languages (chapter 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

Page 15: programming and languages (chapter 14)

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.

Page 16: programming and languages (chapter 14)

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

Page 17: programming and languages (chapter 14)

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

Page 18: programming and languages (chapter 14)

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

-AGILE DEVELOPMENT starts with core program functionality, then expands until the customer is satisfied with the results.

Page 19: programming and languages (chapter 14)

CASE and OOPCASE

● 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.

Page 20: programming and languages (chapter 14)

GENERATIONS OF PROGRAMMING LANGUAGES

Page 21: programming and languages (chapter 14)

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.

Page 22: programming and languages (chapter 14)

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”

Page 23: programming and languages (chapter 14)

CARRIERS IN IT

Page 24: programming and languages (chapter 14)

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

Page 25: programming and languages (chapter 14)