+ 1-888-787-5890  
   + 1-302-351-4405  
 
 
 
 

Essay/Term paper: Procedures, parameters & sub-programs

Essay, term paper, research paper:  Internet

Free essays available online are good but they will not follow the guidelines of your particular writing assignment. If you need a custom term paper on Internet: Procedures, Parameters & Sub-Programs, you can hire a professional writer here to write you a high quality authentic essay. While free essays can be traced by Turnitin (plagiarism detection program), our custom written essays will pass any plagiarism test. Our writing service will save you time and grade.



Procedures, Parameters & Sub-Programs

In any modern programming language, procedures play a vital role in the
construction of any new software. These days, procedures are used instead of
the old constructs of GOTO and GOSUB, which have since become obsolete.

Procedures provide a number of important features for the modern software
engineer:-

Programs are easier to write. Procedures save a large amount of time during
software development as the programmer only needs to code a procedure once, but
can use it a number of times. Procedures are especially useful in recursive
algorithms where the same piece of code has to be executed over and over again.
The use of procedures allows a large and complex program to be broken up into a
number of much smaller parts, each accomplished by a procedure. Procedures also
provide a form of abstraction as all the programmer has to do is know how to
call a procedure and what it does, not how it accomplishes the task.

Programs are easier to read. Procedures help to make programs shorter, and thus
easier to read, by replacing long sequences of statements with one simple
procedure call. By choosing goo procedure names, even the names of the
procedures help to document the program and make it easier to understand.

Programs are easier to modify. When repeated actions are replaced by one
procedure call, it becomes much easier to modify the code at a later stage, and
also correct any errors. By building up the program in a modular fashion via
procedures it becomes much easier to update and replace sections of the program
at a later date, if all the code for the specific section is in a particular
module.

Programs take less time to compile. Replacing a sequence of statements with
once simple procedure call usually reduces the compilation time of the program,
so long as the program contains more than one reference to the procedure!

Object programs require less memory. Procedures reduce the memory consumption
of the program in two ways. Firstly they reduce code duplication as the code
only needs to be stored once, but the procedure can be called many times.
Secondly, procedures allow more efficient storage of data, because storage for a
procedure's variables is allocated when the procedure is called and deallocated
when it returns.

We can divide procedures into two groups:-

Function procedures, are procedures which compute a single value and whose calls
appear in expressions

For example, the procedure ABS is a function procedure, when given a number x,
ABS computes the absolute value of x; a call of ABS appears in an expression,
representing the value that ABS computes.

Proper procedures, are procedures whose calls are statements

For example, the procedure INC is a proper procedure. A call of INC is a
statement; executing INC changes the value stored in a variable.

Procedures have only one real disadvantage: Executing a procedure requires
extra time because of the extra work that must be done both when the procedure
is called, and when it returns.

Most of the time however, the advantages of using procedures heavily outweigh
this minor disadvantage.

Most procedures depend on data that varies from one call to the next, and for
this reason, Modula-2 allows a procedure heading to include a list of
identifiers that represent variables or expressions to supply when calling the
procedure. The programmer can use these identifiers, known as formal
parameters, in the body of the procedure in the same fashion as ordinary
variables.

A call of a procedure with parameters must include a list of actual parameters.
The number of actual parameters must be the same as the number of formal
parameters. Correspondence between the actual and formal parameters is by
position, so the first actual parameter corresponds to the first formal
parameter, the second actual parameter corresponds to the second formal
parameter, and so on. The type of each actual parameter must match the type of
the corresponding formal parameter.

Modula-2 provides to kinds of formal parameters:-

Variable parameters. In a procedure heading, if the reserved word VAR precedes
a formal parameter, then it is a variable parameter. Any changes made to a
variable parameter within the body of the procedure also affect the
corresponding actual parameter in the main body of the program.

Value parameters. If the reserved word VAR does not precede a formal parameter
then it is a value parameter. If a formal parameter is a value parameter, the
corresponding actual parameter is protected from change, no matter what changes
are made to the corresponding parameter in the procedure.

To sum up, variable parameters allow information to flow both into and/or out of
a procedure, whereas value parameters are one way and only allow information
into a procedure.

Most Modula-2 systems allow a program to "call" a program module as if it were a
procedure. We call a module used in this way a subprogram module or just a
subprogram. The commands for calling another program are not part of Modula-2
itself, but are provided by a procedure in a library module. The command used
in most Modula-2 systems for calling a sub-program is CALL, and a number of
parameters are usually passed along with this procedure so as to allow the two
programs to communicate with each other, but there is no way to supply
parameters to a subprogram. The parameters passed only indicate things like
whether the sub-program was executed correctly and did not terminate early
because of an error.

The primary reason for using subprograms is to reduce the amount of memory
required to execute a program. If a program is too large to fit into memory,
the programmer can often identify one or more modules, that need not exist
simultaneously. The main module can then call these modules as subprograms when
needed. Once a subprogram has completed execution, it returns control to the
main program, which can then call another sub program. All subprograms share
the same area of memory, and because only one is resident at a time, the memory
requirements of the overall program are greatly reduced.

 

Other sample model essays:

Propaganda in the Online Free Speech Campaign Propaganda and Mass Communication July 1, 1996 In February 1996, President Bill Clinton signed into law the Telecommunications Act of 1...
Protecting A Computer About two hundred years before, the word "computer" started to appear in the dictionary. Some people even didn't know what is a computer. However, most of the pe...
Quality Issues In System Development The period between the 1970's and 1980's was a time of great advancement in computer hardware technology which took an industry still in it's infanc...
Questions of Ethics In Computer Systems and Their Future 1) Identify and discuss security issues and considerations evident for Information Systems And computerization in the brokerage in...
Radar: A Silent Eye in the Sky Daniel Brosk Period Two Today's society relies heavily on an invention taken for granted: radar. Just about everybody uses radar, whether they realize it or ...
Regulating The Internet: Who's In Charge James H Huff English 111G Fall 1996 The internet was started by the military in the late forties, and has since grown to an incredibly large an...
Response To AOL Controversy The article "America Online, while you can" by Bob Woods is all about the hoopla concerning the fact that America Online, or AOL, has not been able to accommoda...
Review of On-line Publications Because of the prevalence of the internet in today's society many thousands of papers now publish an on-line edition. It is through the use of this medium th...
Internet / Robotics
Robotics The image usually thought of by the word robot is that of a mechanical being, somewhat human in shape. Common in science fiction, robots are generally depicted as working in the ...
Technology / Save The Internet
Save The Internet Did you know that 83.5% of the images available on the Internet were pornographic (Kershaw)? Did you know that pornography on the Internet is readily available to curious...
Experience with Dream Essay - Reliable and great customer service. Quality of work - High quality of work.
, ,
Dream Essay - Very reliable and great customer service. Encourage other to try their service. Writer 91463 - Provided a well written Annotated Bibliography with great deal of detail per th
, ,
it is always perfect
, ,
The experience with Dream Essay is stress free. Service is excellent and forms various forms of communication all help with customer service. Dream Essay is customer oriented. Writer 17663
, ,
Only competent & proven writers
Original writing — no plagiarism
Our papers are never resold or reused, period
Satisfaction guarantee — free unlimited revisions
Client-friendly money back guarantee
Total confidentiality & privacy
Guaranteed deadlines
Live Chat & 24/7 customer support
All academic and professional subjects
All difficulty levels
12pt Times New Roman font, double spaced, 1 inch margins
The fastest turnaround in the industry
Fully documented research — free bibliography guaranteed
Fax (additional info): 866-332-0244
Fax (additional info): 866-308-7123
Live Chat Support
Need order related assistance?—Click here to submit a inquiry
© Dreamessays.com. All Rights Reserved.
Dreamessays.com is the property of MEDIATECH LTD