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
Question 1 Classify and explain the different types of computers Question 2 List and explain the commonly used input devices Question 3 What is binary number system? Exp

In this assignment, you should create a class called ToDoMenu which has a main method that contains the code that implements a command-line menu for managing a collection of ToDoIt

QUESTION a) The handling of the INVITE transaction in SIP is completely different from the handling of other transactions. The handling of the INVITE is one of the most complex

Header contains routing and error control information Payload carries the actual user information, either voice, data or video

While pipelining can cruelly cut the time taken to execute a program, there are troubles that cause it to not work as well as it possibly shall. The three stages of the instruction

Here are the more specific requirements and the related points - use the below as a check-off list when you make your presentation.  Please note . . . many of the requirements are

If you have to consider the installation of communications packages, the same questions have to be asked. (a) Does the software and the modem support the necessary transmission

how can use joystick

Question 1 What are the advantages of Computer Interactive Graphics? Question 2 Which are the different types of camera views available in Maya? Question 3 Explain

what is cai