Subroutine and functions, Basic Computer Science

Assignment Help:

Subroutine and Functions:

 In a program, it is often necessary to repeat a statement or group of statements at several points to accomplish a particular task. Repeating the same statement in a program each time makes a program lengthy and reduces readability. These problems could be sorted out if the necessary statements could be written once and then referred to each time they are needed. This is the purpose of a subprogram. Basically there are two different types of subprograms, called functions and subroutines.  Making subprograms allows tackling small pieces of a problem individually. 

Once each piece is working correctly then the pieces are integrated together to create the complete solution of the problem. To implement functions and subroutines, we require writing the main program that references all of the subprograms in the desired order and also writing the subprograms. This can  be done in any order that is convenient. 


Related Discussions:- Subroutine and functions

Describe the binary search algorithm, QUESTION 1 Describe the binary se...

QUESTION 1 Describe the binary search algorithm using an example of your own. QUESTION 2 (a) By showing all your workings, give a big-O estimate for f(x) = (x + 1)lo

Python Strings and Python Lists, Python Strings: Strings in Python are rec...

Python Strings: Strings in Python are recognized as an adjacent set of characters in among quotation marks. Python permits for either pairs of single or double quotes. Subsets of s

Diskless workstations, Diskless workstations:    Most people assume th...

Diskless workstations:    Most people assume that the operating system is stored on a disk that is connected directly to the computer, but this is not necessarily true. If the

Computer Networking and configuaration, Ask queYou are hired as a Chief Tec...

Ask queYou are hired as a Chief Technology Officer (CTO) of a startup company, which has two branches; one Los Angeles and one in San Francisco. The company hired employees to begi

What is Load and store the assembly programs?, It would not emerge practica...

It would not emerge practical to type an entire program each time it is required, and to avoid this it is possible to store a program on the disk, with the vast advantage that by b

Need a help, i am currently studying my computer science engineering 2nd yr...

i am currently studying my computer science engineering 2nd yr. i am unable to select what specification should i take please help me

Embedded operating systems, Embedded Operating Systems, Devices have EOS bu...

Embedded Operating Systems, Devices have EOS built-in, OPERATING SYSTEM embed on the System itself, Cell phones, PDAs, medical equipment Fast, Application specific Stable a

Unix, How do I change file permissions? Every time I execute chmod commands...

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

CAI, what is CAI? explain its pit falls.

what is CAI? explain its pit falls.

Ricochet wireless data network, The Internet is replete with great success ...

The Internet is replete with great success stories and sad failures. While it is always nice to hear about the successes, more can probably be learned from the failures. In this ca

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd