The document discusses user-defined functions in C++. It defines functions as modules that help develop and maintain large programs by breaking them into smaller pieces. Functions allow code reusability by defining blocks of code that can be invoked multiple times from different parts of a program. The document provides examples of function definitions, prototypes, calling functions by passing arguments, and defining functions that return values. It also discusses local variables, parameters, and built-in math library functions.
A class that automates conversion from a C++ recursive function to an iterative function. It allow the recursive function to preserve its structure by reproducing the "call stack" on an std::stack. The examples use combinatorics to illustrate usage.
Python is a high level language focused on readability. The Python community developed the concept of "Pythonic Code", requiring not only semantic correctness, but also conformity to universally acknowledged stylistic criteria.
A pre-requisite to write pythonic code is to write idiomatic code. Using the right idioms is a matter of acquired taste and experience, however, some idioms are quite easy to learn.
This presentation focuses on some of these idioms and other stylistic criteria:
* for vs. while
* iterators, itertools
* code conventions (space invaders)
* avoid default values bugs
* first order functions
* internal/external iterators
* substituting the switch statement
* properties, attributes, read only objects
* named tuples
* duck typings
* bits of metaprogramming
* exception management: LBYL vs. EAFP
Random number generation (in C++) – past, present and potential future Pattabi Raman
In numerical calculation, Monte Carlo simulations plays very important role. The Monte Carlo simulations are solid numerical equations sailing on thousands of random numbers and converges to a result. This presentation briefs about random number generations.
A class that automates conversion from a C++ recursive function to an iterative function. It allow the recursive function to preserve its structure by reproducing the "call stack" on an std::stack. The examples use combinatorics to illustrate usage.
Python is a high level language focused on readability. The Python community developed the concept of "Pythonic Code", requiring not only semantic correctness, but also conformity to universally acknowledged stylistic criteria.
A pre-requisite to write pythonic code is to write idiomatic code. Using the right idioms is a matter of acquired taste and experience, however, some idioms are quite easy to learn.
This presentation focuses on some of these idioms and other stylistic criteria:
* for vs. while
* iterators, itertools
* code conventions (space invaders)
* avoid default values bugs
* first order functions
* internal/external iterators
* substituting the switch statement
* properties, attributes, read only objects
* named tuples
* duck typings
* bits of metaprogramming
* exception management: LBYL vs. EAFP
Random number generation (in C++) – past, present and potential future Pattabi Raman
In numerical calculation, Monte Carlo simulations plays very important role. The Monte Carlo simulations are solid numerical equations sailing on thousands of random numbers and converges to a result. This presentation briefs about random number generations.
Bartosz Milewski, “Re-discovering Monads in C++”Platonov Sergey
Once you know what a monad is, you start seeing them everywhere. The std::future library of C++11 was an example of an incomplete design, which stopped short of recognizing the monadic nature of futures. This is now being remedied in C++17, and there are new library additions, like std::expected and the range library, that are much more monad-conscious. I’ll explain what a monad is using copious C++ examples.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Part 3-functions
1. C++ PROGRAMMING SKILLS
Part 3
User-Defined Functions
• Introduction
• Function Definition
• Void function
• Global Vs Local variables
• Random Number Generator
• Recursion
• Function Overloading
• Sample Code
2. Functions in C++
• Experience has shown that the best way to develop and maintain large
programs is to construct it from smaller pieces(Modules)
• This technique Called “Divide and Conquer”
Bad Development Approach Wise Development Approach
main()
main() •Easer To {
{ -----
----- Design ----
----- Build }
----- Debug
----- Extend function f1()
. Modify {
. Understand ---
. Reuse ---
---- Better Organization }
-----
----- function f2()
Return 0; {
} ---
---
}
3. .)Functions in C++(Cont
• In FORTRAN Modules Known as Subprograms
• In Pascal Modules known as Procedures &
Functions
• In C++ Modules Known as Functions & Classes
• Programs use new and “prepackaged” modules
– New: programmer-defined functions and classes
– Prepackaged: from the standard library
4. ++About Functions in C
• Functions invoked by a function–call-statement which consist of
it’s name and information it needs (arguments)
• Boss To Worker Analogy
A Boss (the calling/caller function) asks a worker (the called
function) to perform a task and return result when it is done.
Boss
Main
Worker
Worker Worker
Function Z
Function A Function B
Worker Worker
Note: usual main( ) Calls other
Function B1 Function B2 functions, but other functions
can call each other
5. Function Calling
• Functions called by writing
functionName (argument);
or
functionName(argument1, argument2, …);
• Example
cout << sqrt( 900.0 );
• sqrt (square root) function
• The preceding statement would print 30
• All functions in math library return a double
• Function Arguments can be:
- Constant sqrt(9);
- Variable sqrt(x);
- Expression sqrt( x*9 + y) ;
sqrt( sqrt(x) ) ;
6. Function Calling
• Calling/invoking a function
– sqrt(x);
– Parentheses an operator used to call function
• Pass argument x
• Function gets its own copy of arguments
– After finished, passes back result
Function Name argument Output
3
cout<< sqrt(9);
Parentheses used to enclose argument(s)
7. Math Library Functions Revisited
Method Description Example
ceil( x ) rounds x to the smallest integer ceil( 9.2 ) is 10.0
not less than x ceil( -9.8 ) is -9.0
cos( x ) trigonometric cosine of x cos( 0.0 ) is 1.0
(x in radians)
exp( x ) exponential function ex exp( 1.0 ) is 2.71828
exp( 2.0 ) is 7.38906
fabs( x ) absolute value of x fabs( 5.1 ) is 5.1
fabs( 0.0 ) is 0.0
fabs( -8.76 ) is 8.76
floor( x ) rounds x to the largest integer floor( 9.2 ) is 9.0
not greater than x floor( -9.8 ) is -10.0
fmod( x, y ) remainder of x/y as a floating- fmod( 13.657, 2.333 ) is 1.992
point number
log( x ) natural logarithm of x (base e) log( 2.718282 ) is 1.0
log( 7.389056 ) is 2.0
log10( x ) logarithm of x (base 10) log10( 10.0 ) is 1.0
log10( 100.0 ) is 2.0
pow( x, y ) x raised to power y (xy) pow( 2, 7 ) is 128
pow( 9, .5 ) is 3
sin( x ) trigonometric sine of x sin( 0.0 ) is 0
(x in radians)
sqrt( x ) square root of x sqrt( 900.0 ) is 30.0
sqrt( 9.0 ) is 3.0
tan( x ) trigonometric tangent of x tan( 0.0 ) is 0
(x in radians)
Fig. 3.2 Math library functions.
8. Functions
• Functions
– Modularize a program
– Software reusability
• Call function multiple times
• Local variables
– Known only in the function in which they are defined
– All variables declared in function definitions are local variables
• Parameters
– Local variables passed to function when called
– Provide outside information
9. Function Definition
• Function prototype
– Tells compiler argument type and return type of function
– int square( int );
• Function takes an int and returns an int
– Explained in more detail later
• Calling/invoking a function
– square(x);
– Parentheses an operator used to call function
• Pass argument x
• Function gets its own copy of arguments
– After finished, passes back result
10. Function Definition
• Syntax format for function definition
returned-value-type function-name (parameter-list)
{
Declarations of local variables and Statements
}
– Parameter list
• Comma separated list of arguments
– Data type needed for each argument
• If no arguments, use void or leave blank
– Return-value-type
• Data type of result returned (use void if nothing
returned)
11. Function Definition
• Example function
int square( int y )
{
return y * y;
}
• return keyword
– Returns data, and control goes to function’s caller
• If no data to return, use return;
– Function ends when reaches right brace
• Control goes to caller
• Functions cannot be defined inside other
functions
12. // Creating and using a programmer-defined function.
#include <iostream.h>
Function prototype: specifies
int square( int ); // function prototype data types of arguments and
return values. square
int main()
expects an int, and returns
{
an int.
// loop 10 times and calculate and output
// square of x each time
for ( int x = 1; x <= 10; x++ )
cout << square( x ) << " "; // function call
Parentheses () cause function to be called.
cout << endl;
When done, it returns the result.
return 0; // indicates successful termination
} // end main
// square function definition returns square of an integer
int square( int y ) // y is a copy of argument to function
{
return y * y; // returns square of y as an int
Definition of square. y is a
copy of the argument passed.
} // end function square Returns y * y, or y squared.
1 4 9 16 25 36 49 64 81 100
13. compute square and cube of numbers [1..10] using functions
#include<iostream.h>
int square(int); // prototype Output
int cube(int); // prototype 1 square=1
main() 1 cube=1
{ int i; 2 square=4
2 cube=8
for (int i=1;i<=10;i++){ .
.
cout<< i<< “square=“ << square(i) << endl; .
cout<< i<< “cube=“ <<cube(i) << endl; .
} // end for 10 square=100
return 0; 10 cube=1000
} // end main function
int square(int y) //function definition
{
return y*y; // returned Result
}
int cube(int y) //function definition
{
return y*y*y; // returned Result
}
14. // Finding the maximum of three floating-point (real) numbers.
#include <iostream.h>
double maximum( double, double, double ); // function prototype
int main()
{
double number1, number2;
double number3; Function maximum takes 3
arguments (all double) and
cout << "Enter three real numbers: "; returns a double.
cin >> number1 >> number2 >> number3;
// number1, number2 and number3 are arguments to the maximum function call
cout << "Maximum is: "
<< maximum( number1, number2, number3 ) << endl;
return 0; // indicates successful termination
} // end main
// function maximum definition. x, y and z are parameters
double maximum( double x, double y, double z )
{
double max = x; // assume x is largest Enter three real numbers: 99.32 37.3 27.1928
if ( y > max ) // if y is larger, Maximum is: 99.32
max = y; // assign y to max
Enter three real numbers: 1.1 3.333 2.22
if ( z > max ) // if z is larger,
Maximum is: 3.333
max = z; // assign z to max
return max; // max is largest value
} // end function maximum
15. Function Prototypes
• Function prototype contains
– Function name
– Parameters (number and data type)
– Return type (void if returns nothing)
– Only needed if function definition after function call
• Prototype must match function definition
– Function prototype
double maximum( double, double, double );
– Definition
double maximum( double x, double y, double
z )
{
…
}
16. void Function takes arguments
If the Function does not RETURN result, it is called void Function
#include<iostream.h>
void add2Nums(int,int);
main()
{ int a, b;
cout<<“enter tow Number:”;
cin >>a >> b;
add2Nums(a, b)
return 0;
}
void add2Nums(int x, int y)
{
cout<< x<< “+” << y << “=“ << x+y;
}
17. void Function take no arguments
If the function Does Not Take Arguments specify this with EMPTY-LIST OR
write void inside
#include<iostream.h>
void funA();
void funB(void)
main()
{ Will be the same
funA(); in all cases
funB();
return 0;
}
void funA()
{
cout << “Function-A takes no arqumentsn”;
}
void funB()
{
cout << “Also Function-B takes No argumentsn”;
}
18. Remarks on Functions
• Local variables
– Known only in the function in which they are defined
– All variables declared inside a function are local variables
• Parameters
– Local variables passed to function when called (passing-
parameters)
• Variables defined outside and before function main:
– Called global variables
– Can be accessible and used anywhere in the entire
program
19. Remarks on Functions
• Omitting the type of returned result defaults to int, but
omitting a non-integer type is a Syntax Error
• If a Global variable defined again as a local variable in a
function, then the Local-definition overrides the Global
defining
• Function prototype, function definition, and function call
must be consistent in:
1- Number of arguments
2- Type of those arguments
3-Order of those arguments
20. Local vs Global Variables
#include<iostream.h>
int x,y; //Global Variables
int add2(int, int); //prototype
main()
{ int s;
x = 11;
y = 22;
cout << “global x=” << x << endl;
cout << “Global y=” << y << endl;
s = add2(x, y);
cout << x << “+” << y << “=“ << s;
cout<<endl;
cout<<“n---end of output---n”;
global x=11
return 0;
}
global y=22
int add2(int x1,int y1) Local x=44
{ int x; //local variables 11+22=33
x=44; ---end of output---
cout << “nLocal x=” << x << endl;
return x1+y1;
}
21. Finding Errors in Function Code
int sum(int x, int y)
{
int result;
result = x+y;
}
this function must return an integer value as indicated in the
header definition (return result;) should be added
----------------------------------------------------------------------------------------
-
int sum (int n)
{ if (n==0)
return 0;
else
n+sum(n-1);
}
the result of n+sum(n-1) is not returned; sum returns an improper
result, the else part should be written as:-
else return n+sum(n-1);
22. Finding Errors in Function Code
void f(float a);
{
float a;
cout<<a<<endl;
}
; found after function definition header.
redefining the parameter a in the function
void f(float a)
{
float a2 = a + 8.9;
cout <<a2<<endl;
}
23. Finding Errors in Function Code
void product(void)
{
int a, b, c, result;
cout << “enter three integers:”;
cin >> a >> b >> c;
result = a*b*c;
cout << “Result is” << result;
return result;
}
According to the definition it should not return a value , but in the block
(body) it did & this is WRONG.
Remove return Result;
24. Function Call Methods
• Call by value
• A copy of the value is passed
• Call by reference
• The caller passes the address of the value
• Call by value
Up to this point all the calls we have seen are call-by-value, a copy
of the value (known) is passed from the caller-function to the called-
function
Any change to the copy does not affect the original value in the
caller function
Advantages, prevents side effect, resulting in reliable software
25. Function Call Methods
• Call By Reference
We introduce reference-parameter, to perform call by reference. The caller
gives the called function the ability to directly access the caller’s value, and to
modify it.
A reference parameter is an alias for it’s corresponding argument, it is stated
in c++ by “flow the parameter’s type” in the function prototype by an
ampersand(&) also in the function definition-header.
Advantage: performance issue
void function_name (type &);// prototype
main()
{
-----
------
}
void function_name(type ¶meter_name)
26. Function Call Example
#include<iostream.h>
int squareVal(int); //prototype call by value function
void squareRef(int &); // prototype call by –reference function
int main()
{ int x=2; z=4;
cout<< “x=“ << x << “before calling squareVal”;
cout << “n” << squareVal(x) << “n”; // call by value
cout<< “x=“ << x << “After returning”
cout<< “z=“ << z << “before calling squareRef”;
squareRef(z); // call by reference
cout<< “z=“ << z<< “After returning squareRef”
return 0;
x=2 before calling squareVal
}
4
int squareVal(int a)
x=2 after returning
{
z=4 before calling squareRef
return a*=a; // caller’s argument not modified
z=16 after returning squareRef
}
void squarRef(int &cRef)
{
cRef *= cRef; // caller’s argument modified
}
27. Random Number Generator
• rand function generates an integer between 0 and RAND-
MAX(~32767) a symbolic constant defined in <stdlib.h>
• You may use modulus operator (%) to generate numbers within a
specifically range with rand.
//generate 10 random numbers open-range
int x;
for( int i=0; i<=10; i++){
x=rand();
cout<<x<<“ “;
}
-------------------------------------------------------
//generate 10 integers between 0……..49
int x;
for( int i=0; i<10; i++){
x=rand()%50;
cout<<x<<“ “;
}
28. Random Number Generator
//generate 10 integers between 5…15
int x;
for ( int i=1; i<=10; i++){
x= rand()%11 + 5;
cout<<x<<“ “;
}
------------------------------------
//generate 100 number as simulation of rolling a
dice
int x;
for (int i=1; i<=100; i++){
x= rand%6 + 1;
cout<<x<<“ “;
}
29. Random Number Generator
• the rand( ) function will generate the same set of random
numbers each time you run the program .
• To force NEW set of random numbers with each new run
use the randomizing process
• Randomizing is accomplished with the standard library
function srand(unsigned integer); which needs a
header file <stdlib.h>
Explanation of signed and unsigned integers:
int is stored in at least two-bytes of memory and can
have positive & negative values
unsigned int also stored in at least two-bytes of
memory but it can have only positive values 0…..65535
30. Randomizing with srand
#include<iostream.h>
#include<iomanip.h>
#include<stdlib.h>
int main()
{
int i;
unsigned num;
// we will enter a different number each time we run
cin>>num;
srand(num);
for(i=1; i<=5; i++)
cout<<setw(10)<< 1+rand()%6;
return 0;
}
Output for Multiple Runs
19 6 1 1 4 2 1
18 6 1 5 1 4 4 Different-set of Random
3 1 2 5 6 2 4 numbers
0 1 5 5 3 5 5
3 1 2 5 6 3 4
32. Recursion and Recursive Functions
• Main calls another function…..normal
• A function calls another
function2….normal
• A function calls itself ?! Possible?? YES
A recursive function is one that call itself.
33. Concept Of recursion
• A recursive function is called to solve a problem
• The function knows to solve only the simplest cases
or so-called base-cases
• Thus if the function called with a base-case, it simply
returns a result. But if it is called with more complex
problem, the function divides the problem into two
conceptual pieces, one knows how to do, and another
doesn't know what to do.
• The second case/piece must resemble the original
problem, but be a slightly simpler/smaller version of
the original problem
34. .(Concept Of recursion (cont
• Thus the function launches (calls) a fresh copy of
itself to work on the smaller problem –this is related
as a Recursive-call/recursive step.
• The function keeps dividing each new sub problem
into two conceptual pieces until eventually terminates
after converging on the base-case.
• The function thus recognize the base-case and returns
a result to the previous copy of the way up the line
until original call of the function returns the final
result to main.
35. Finding Factorial Recursively
5! Final value=120
5!
5!=5*24=120 returned
5*4! 5*4!
4!=4*6=24 returned
4*3! 4*3!
3!=3*2=6 returned
3*2! 3*2!
2!=2*1=2 returned
2*1! 2*1!
1
1 1
36. Finding Factorial Recursively
//Recursive factorial Function
#include<iostream.h>
#include<iomonip.h>
unsigned lion factorial(unsigned long);//prototype
int main()
{
int num;
cout<<“enter a positive integer:”;
cin>>num;
cout<<“factorial=“<<factorial(num);
return 0;
}
unsigned long factorial(unsigned long n)
{
if ( n <= 1) //the base case
return 1;
else
return n * factorial (n - 1);
}
37. Function Overloading
• Function overloading
– Functions with same name and different
parameters
– Should perform similar tasks
• I.e., function to square ints and function to square floats
int square( int x) {return x * x;}
float square(float x) { return x * x; }
• A call-time c++ complier selects the proper function by
examining the number, type and order of the parameters