procedure oriented languages

12
Visual Programming Environment

Upload: shubham-saini

Post on 04-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 1/12

Visual Programming

Environment

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 2/12

Procedure and Event- oriented

Languages

• Besides low-level and high-level languages,computer languages can be classifiedas procedure-oriented or event-oriented.

• Procedure-oriented languages tend to runwithout human interference or without takingsome action by the user.

Event-oriented languages are different fromProcedure-oriented languages because theydepend on the user.

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 3/12

Procedure and Event- oriented

Languages

• In Procedure-oriented languages a computerprogram is executed by a simple run instruction, and usually runs from top to

bottom, with all the code executed until theprogram ends.

• Event-oriented languages wait for the user totake some action before they execute. Theprogram waits for an event (or happening) tooccur before beginning a program execution.

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 4/12

Procedure and Event- oriented

Languages

• Prior to 1990, most commercial high-level

languages were procedure-oriented

languages. The emphasis in writing a

computer program was to identify a set of

processing tasks and to describe the steps

important to each task. Collectively, the set of

tasks represented a procedure: a listing of aset of tasks required to perform an activity.

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 5/12

Procedure and Event- oriented

Languages• As an example, consider the procedure required in

processing an employee’s pay check, in which the stepsof the procedure are expressed as tasks:

 – Get employee name.

 – Get hours worked. – Get hourly wage.

 – Multiply hours worked by the hourly wage to computegross pay.

 – Compute taxes based on gross pay.

 – Subtract taxes and other deduction (such as union dues)from gross pay to compute net pay.

 – Print the employee’s check. 

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 6/12

Procedure and Event- oriented

Languages

• Event-oriented languages became possible

with the advent of the Macintosh operating

system for Apple Macintosh computers and

Microsoft Windows for MS-DOS computer

systems. Both environments were designed to

bring hardware and software together into a

standard user interface by employinga graphical user interface (GUI). 

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 7/12

Procedure and Event- oriented

Languages

• An event-oriented language implies thatan application (the computer program) waitsfor an event  to occur before taking any

action.• What is an event? It might be the press of a

key on the keyboard or the click of a mousebutton. With these events (there are manytypes), the computer waits for a key press or amouse click.

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 8/12

Difference b/w Procedure and Event-

oriented Languages

• In the event driven programming language we

can directly interact with user interface by

making use of mouse or any other means of

controls.

• But in procedural programs you cannot

interact with user interface through any of the

control. you can only interact through codes.

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 9/12

Difference Contd.

• Events are caused by actions the user performs.

For example, clicking the mouse generates a

mouse event, pressing a key on the keyboard

generates a keyboard event, and so on.

• In procedural-driven or top-down architectures,

the application executes a set of instructions in a

specified sequence to perform a task. Thestructure and sequence of the program of a

procedural-driven application control the

execution order , not the user actions.

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 10/12

Difference Contd. 

• In an event-driven program, the program firstwaits for events to occur, responds to thoseevents, then returns to wait for the next event.

• The program response depends on the code written for thatspecific event. The order in which an event-driven programexecutes depends on which events occur and on the order inwhich those events occur. While the program waits for thenext event, it frees up CPU resources that might be used toperform other processing tasks.

• In Procedure-oriented languages the programexecution begins in main and then flows throughmethod calls and control statements in a fairly

predictable manner.

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 11/12

Difference Contd. 

• Procedural: Monolithic programs that run

from start to finish with no intervention from

user other than input. E.g.

 – Basic, QBasic

 – COBOL

 – FORTRAN

 – C

8/13/2019 Procedure Oriented Languages

http://slidepdf.com/reader/full/procedure-oriented-languages 12/12

Difference Contd. 

• Event oriented: Programs that use objects

which respond to events; use small segments

to code for each object

 – Visual Basic

 – Visual C++