Question
You are to find all the absolute value functions you can and rewrite all of them overloading the abs function name. At a minimum, you
You are to find all the absolute value functions you can and rewrite all of them overloading the abs function name. At a minimum, you should have the int, long, float, and double types represented.
Variables:
Declare four variables of type int, double, float, long and initialize them to some random values:
int i = -4;
double d = 7.5;
Functions:
Call your functions Abs( )
From main, call the four overloaded functions with these variables.
In each function, place a debug statement to print out which function is being called. For example:
cout<<"Abs(int) is being called"< Place appropriate cout functions in main to let the user know what is being called, how it's being called and what the result it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started