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
INTERNET Internet: The global network of computers linked by exclusive and regular phone lines and microwave and satellite signals. Extranet: An extranet is the part of

Problem: (a) Using appropriate examples describe what are System software and Application Software. (b) Explain four tasks of file management a user frequently performs i

Stable wireless networks and mobile devices online tutoring In Bluetooth it is a basically a proprietary open super wireless technology standard for exchanging data over the sh

Memory Management: The purpose of the memory management system is to load programs into memory in such a way as to give each program loaded  the memory that it requires for

Mobile telephone networks started with analog technology. Analog cellular networks were known as first generation (1G) networks. Such networks had limited capacity, and were subjec

QUESTION (a) (i) Why is the Random class in the .NET framework not suitable for generating random bytes for cryptography purposes? (ii) Mention two characteristics required

Ask quwhat is binary estion #Minimum 100 words accepted#

In a certain word game a player can buy vowels and consonants. The first vowel is free; each additional vowel cost $1. The first two consonants are free; each additional constant c

QUESTION (a) What is an abstract data type? (b) Give two limitations of the array implementation of lists. (c) Give the major disadvantage of the dynamic implementation o

Hardware Hardware includes the cable and a Hub/Switch that will connect the participating computers together. Printers or any other peripherals connected to one computer can