B,D,E are the answers for your question :)
Answer:
#include <stdio.h>
int main()
{
int avg = 0;
int sum =0;
int x=0;
/* Array- declaration – length 4*/
int num[4];
/* We are using a for loop to traverse through the array
* while storing the entered values in the array
*/
for (x=0; x<4;x++)
{
printf("Enter number %d \n", (x+1));
scanf("%d", &num[x]);
}
for (x=0; x<4;x++)
{
sum = sum+num[x];
}
avg = sum/4;
printf("Average of entered number is: %d", avg);
return 0;
}
The anchor line should be lower from the BOW, ATTACH THE LINE TO THE BOW CLEAT. Anchoring from the bow prevents taking on of water into the vessel which can lead to swamping or capsizing of the vessel. It is recommended never to tie the anchor line to the stern, the additional weight could bring water inside the boat.
Answer:
class Automobile {
virtual void drive ()=0;
}
Explanation:
In C++, an abstract class is one which cannot be instantiated. However it can be subclassed. A class containing a pure virtual function is considered an abstract class. A virtual function is preceded by the virtual keyword. For example:
virtual void drive();
In addition , if a virtual function is pure, it is indicated using ' = 0 ;' syntax.
For example:
virtual void drive() = 0;
Of the given options:
class Automobile {
virtual void drive ()=0;
}
represents an abstract class.
Answer:
public boolean equals(Object other)
{
// check correct instance
if (other instanceof IntTree)
{
try
{
IntTree otherTree = (IntTree) other;
return equals(overallRoot, otherTree.overallRoot);
}
// caught exceptions
catch (Exception e)
{
return false;
}
}
return false;
}
public boolean equals(IntTreeNode tree1, IntTreeNode tree2)
{
// if reach ends
if (tree1 == null && tree2 == null)
{
// they are equal
return true;
}
else if (tree1 == null || tree2 == null)
{
// not equal
return false;
}
// check left part
boolean leftPart = equals(tree1.left, tree2.left);
// check current element is same
boolean currentPart = tree1.element.equals(tree2.element);
// check right part
boolean rightPart = equals(tree1.right, tree2.right);
// all are equal
return (leftPart && currentPart && rightPart);
}
Explanation: