Subroutine , Basic Computer Science

Subroutine:  

A subroutine  is a type of subprogram, a piece of code within a larger program that performs a specific task and is relatively independent of the remaining code.  It is also called a procedure, routine or a method.  A subroutine has no value associated with its name. All outputs are defined in terms of arguments; there may be any number of outputs. 

 In most cases, a subroutine needs some information about the circumstances in which it has been called. A procedure that performs repeated or shared tasks uses different information for each call. This information consists of variables, constants, and expressions that you pass to the procedure when you call it.

  A parameter represents a value that the procedure expects you to supply when you call it. You can create a procedure with no parameters, one parameter, or more than one. The part of the procedure definition that specifies the parameters is called the parameter list. 

 An argument represents the value you supply to a procedure parameter when you call the procedure. The calling code supplies the arguments when it calls the procedure. The part of the procedure call that specifies the arguments is called the argument list. For example here is a subroutine to find the sum of three numbers    

Posted Date: 10/23/2012 3:58:31 AM | Location : United States







Related Discussions:- Subroutine , Assignment Help, Ask Question on Subroutine , Get Answer, Expert's Help, Subroutine Discussions

Write discussion on Subroutine
Your posts are moderated
Related Questions
disvange and advantege of providing intternet sservice to customer

i need help with flowcharting a procedure

Give a topology (network diagram) in which there is a link whose failure will change many routes. Give one in which there is a link whose failure will not change any routes

#write a c program to print ant and rod #

What is CAI? Explain its pitfalls

Acting Rationally: Al Capone was finally convicted for tax evasion. Were the police acting rationally? To answer this, we must first look at how the performance of police force

function of arithmetic logic unit

How do I change file permissions? Every time I execute chmod commands it tells me permission denied.

QUESTION (a) Explain what is RMI? (b) Draw a diagram showing the different parts of the Java RMI architecture. (c) What is the function of the RMI security manager and RM

Assess the reliability of data gathered via paid Internet users. Describe and assess the evaluation method being used by the testing company, i.e., nonvisual and verbal recording o