Deliverables:
4. The class Amine has a member function dopamine whose prototype is:
class Amine
{
...
double dopamine (double x);
...
};
and the definition has no default parameters. Which of the following could NOT be the definition of this
member function?
(a)
double Amine::dopamine (double x)
{
joe=x; return joe;
}
(b)
double Amine::dopamine(double x)
{
double joe;
return (joe = x);
}
(c)
double Amine::dopamine (double x)
{
return 5. ;
}
(d)
double dopamine(double x)
{
double joe;
joe = x;
return joe;
}
(e)
double Amine::dopamine ()
{
return 0. ;
}
5. Consider:
int ar[] = {2, 5, 3, 2, -1};
int *ar2;
Check the statements that are problematic, based on these declarations. For each statement below, assume that it follows the declarations immediately with no intervening statements.
In other words, only one of the statements below
would occur in the program.
(a)
ar2 = ar;
(b)
ar2[3] = 7;
(c)
ar[5] = 99;
(d)
ar[3] = ar[4];
(e)
cin >> ar[3];
6. Member function fourier() has 3 overloaded variants. The first two prototypes are shown:
class Transform
{
...
public:
int fourier();
int fourier(int n);
...
};
Which could not represent the 3rd overloaded prototype of this function name?
(a)
int fourier (Transform *t);
(b)
int fourier (Transform *t, int n=2);
(c)
int fourier (int n, float f);
(d)
int fourier (Transform *t = NULL);
(e)
void fourier (int n);
I NEED THE ANSWERS TO THESE ASAP FOR MY HOMEWORK DUE TONIGHT!!!