Identify the compiler errors and state what is wrong with the code.
```
#include
<< using namespace std;
class Dolphin
{
private:
float size;
string name;
public:
Dolphin(){name = “Tosser”; }
void SetSize(float s) { size = s;}
bool operator > ();
};
void Dolphin::operator > () should be operator(Dolphin X)
{
if(X.size > size) return false;
else return true;
}
int main()
{
Dolphin Big, Little;
Big.SetSize(20);
Small.SetSize(15);
if(Big > Little) cout << “bigger”;
else cout << “smaller”.
}
```
```
#include
<< using namespace std;
class Dolphin
{
private:
float size;
string name;
public:
Dolphin(){name = “Tosser”; }
void SetSize(float s) { size = s;}
bool operator > ();
};
void Dolphin::operator > () should be operator(Dolphin X)
{
if(X.size > size) return false; << need input object X to do this
else return true;
}
int main()
{
Dolphin Big, Little;
Big.SetSize(20);
Small.SetSize(15);
if(Big > Little) cout << “bigger”;
else cout << “smaller”. << need a ; here, and return 0;
}
```
You might also like to view...
How are overloaded functions and default parameter list functions similar?
A. They both have various call statements. B. They both have separate function bodies. C. They both have non-void return types. D. All are correct.
You will not be able to set up the descriptive sections of a PivotTable, such as column headings or row headings, unless the Drop Zones icon is activated in the Design tab of the Ribbon
Indicate whether the statement is true or false
Pages of programs or data are copied from random access memory (RAM) to the virtual memory area of the hard drive.
Answer the following statement true (T) or false (F)
Officers show up at the home of Ima Leevin. A woman answers the door and identifies herself as Ima and gives them permission to search the house. Drug paraphernaila is discovered. The REAL Ima shows up and is arrested. Her attempt to get the evidence dismissed as the result of an illegal search fails. Why is that?
a. The fake Ima had apparent authority to grant permission for the search. b. Once invited in by anyone, officers had the right to look around. c. Permission to search can be given by anyone present. d. Probable cause meant that the warrant was no longer necessary.