Professional Documents
Culture Documents
Objectives: The C++ Programming Skills That Should Be Acquired in This Lab
Objectives: The C++ Programming Skills That Should Be Acquired in This Lab
Function overloading
Objectives
Example
// first definition
int sum(int x, int y)
{
cout<< x+y;
}
int main()
{
sum (10,20);
sum(10.5,20.5);
}
Output
30
31.0
Class Member function overloading
Lab Task
1. Create a class CalculateArea that contains three functions Area. First function
calculates area of circle, second calculate area of rectangle. Third function also
calculate area of triangle. All function has parameters and call the function In
main () and ask the user to input the values..