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

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

Integers, what is the size of a void integer and what is it''s range

what is the size of a void integer and what is it''s range

What are the three basic security provided by ssl, QUESTION (a) Can SSL...

QUESTION (a) Can SSL be used to encrypt email data? Justify your answer (b) What are the three basic security provided by SSL? (c) State the port number used by applicati

Protocol, what protocol is used by DNS name server

what protocol is used by DNS name server

Transaction-based model, Transaction-based model: Here,  the pricing i...

Transaction-based model: Here,  the pricing is based on providing a committed business service, for ex, processing payroll for a global company as part of HR offering and this

Describe FCFS Scheduling algorithm ?, FCFS algorithm also known as: • Firs...

FCFS algorithm also known as: • First-In-First-Out (FIFO) • Run-Until-Done • Run-to-Completion • Possibly, First-Come-First-Served algorithm is the easiest scheduling algorithm i

What is the difference between kernel mode and user mode fun, The differenc...

The difference between kernel mode and user mode gives a rudimentary form of security in the following manner. Convinced instructions could be executed only when the CPU is in kern

Block diagram of computer, Input unit: These are used to read data and tran...

Input unit: These are used to read data and transfer to primary memory contained in CPU through keyboard or floppy disk or mouse etc. Central Processing Unit (CPU): This consists o

Long term goal of artificial intelligence, Long term goal of artificial int...

Long term goal of artificial intelligence: This is not to be complex with the applications of AI programs to other sciences, discussed later. Rather, it is just pointing out th

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