<< Chapter < Page Chapter >> Page >
A general explanation of specific task functions.

Prerequisite material

Critical to this module is the review of two Connexions modules:

  1. m_18861 – Titled: Modularization and C++ Program Layout
  2. m_19145 – Titled: Program Control Functions

You should review these materials before proceeding. If you are viewing this module on-line, links to these items are in the "Links" box to your right.

General concept

Program Control functions which might have similar identifier names usually perform slightly different tasks in one program to another. Looking at the organizational chart or hierarchy chart for two companies, both might have a vice president of production, but producing automobiles is different than producing ice cream. Similar but different. As you go down deeper into an organization you might find the job title of security guard. Notice that the security guard at the automobile plant and the security guard at the ice cream plant have exactly the same job. In fact, they are most likely interchangeable. Within programming when a task gets specific it might be useable in several programs. The calculation of leap year is a good example. Needed for the verification of dates, is there or is there not a 29 th of February for this year. Needed in thousands of programs.

Specific task functions

To create good Specific Task functions you need to do all communication needed via parameter passing. Thus all programs that will use the function will communicate in precisely the same way. In our leap year example, you would communicate into the function the year and the function would return the communication of true or false; meaning it is a leap year and there is a 29 th of February (true) or it is not a leap year (false).

The ability to modularize our program into specific task functions means that we can write the specific task function once making sure it works correctly, then reuse it over and over in many programs. As you can guess there is a balance. Most programs will have some program control functions and some specific task functions. The key to deciding if the function should be a specific task function is usually rooted in the uniqueness of the task so that it can be used in many programs. Specific task functions once created are usually placed into a user defined library then shared with others for use in many programs.

Definitions

user defined library
A file containing specific task functions created by individuals to be used in many programs.

Questions & Answers

Biology is a branch of Natural science which deals/About living Organism.
Ahmedin Reply
what is phylogeny
Odigie Reply
evolutionary history and relationship of an organism or group of organisms
AI-Robot
ok
Deng
what is biology
Hajah Reply
cell is the smallest unit of the humanity biologically
Abraham
what is biology
Victoria Reply
what is biology
Abraham
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Programming fundamentals - a modular structured approach using c++. OpenStax CNX. Jan 10, 2013 Download for free at http://cnx.org/content/col10621/1.22
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Programming fundamentals - a modular structured approach using c++' conversation and receive update notifications?

Ask