A vessel trawling would display______.A.a black ballB.a basketC.a double cone,point to poi

题目

A vessel trawling would display______.

A.a black ball

B.a basket

C.a double cone,point to point

D.none of the above

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

下面程序的输出结果是【】。 inclde include using namespace std; class point {

下面程序的输出结果是【 】。

inclde<iostreamn>

include<math>

using namespace std;

class point

{

private:

double x;

double y;

public:

point(double a,double b)

{

x=a;

y=b;

}

friend double distance(point a,point b);

};

double distance(point a,point b)

{

return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));

}

int main()

{

point p1(1,2);

point p2(5,2);

cout<<distalice(p1,p2)<<endl;

return 0;

}


正确答案:4
4

第2题:

下列程序的执行结果为【 】。include class Point{public:Point(double i, double j)

下列程序的执行结果为【 】。

include <iostream. h>

class Point

{

public:

Point(double i, double j) { x=i; y=j;}

double Area() const { return 0.0;}

private:

double x, y;

};

class Rectangle: public Point

{

public:

Rectangle(double i, double j, double k, double 1)

double Area() const {return w * h;}

private:

double w, h;

};

Rectangle: :Rectangle(double i, double j, double k. double 1): Point(i,j).

{

w=k, h=1

}

void fun(Point &s)

{

cout<<s. Area()<<end1;

}

void main( )

{

Rectangle rec(3.0, 5.2, 15.0. 25.0);

fun(rec)

}


正确答案:×
0 解析:注意本题不同于基类的指针指向派生类对象。Fun函数的形参是Point基类的引用。在可以用基类对象的地方,均可以用派生类替代,完成基类的行为。反之,在使用派生类对象的地方却不能用基类对象代替,这是因为派生类中的某些行为在基类对象中是不存在的。本题调用的是Point类对象的面积函数,其值永远为0。

第3题:

下面程序的输出结果是【】。include include class point{double x; double y;

下面程序的输出结果是【 】。

include <iostream.h>

include <math.h>

class point

{

double x;

double y;

public:

point(double a, double b)

{

x=a;

y=b;

}

friend double distance(point a, point b) ;

};

double distance(point a, point b)

{

return sqrt ((a. x-b.x) * (a. x-b.x)+ (a. y-b. y) * (a. y-b. y) );

}

void main()

{

point p1(1,2);

point p2(5,2);

cout<<distance(p1,p2)<<end1;

}


正确答案:4
4 解析:本题考核友元函数的应用。分析程序:类point中定义了两个私有成员x和y,以及一个友元函数distance。从而,函数 distance可以访问类point中的任何成员。在函数 distance中,返回值为sqrt((a. x-b. x)*(a. x-b. x)+ (a. y-b. y)*(a. y-b. y))。由此可知,函数distance的功能是计算a、b两点之间的距离。在土函数main中,先定义两点:p1(1,2)和p2(5,1)。然后调用函数distance计算两点之间的距离为4,所以程序最后输出为4。

第4题:

A vessel would be referred to as "stiff" when the weight of the cargo is ______.

A.evenly distributed vertically and the double bottoms are full

B.concentrated low and the double bottoms are empty

C.concentrated low and the double bottoms are full

D.concentrated high and the double bottoms are empty


正确答案:C

第5题:

有以下程序:include include using namespace std;class point{private:doubl

有以下程序:#include <iostream>#include <math>using namespace std;class point{private: double x; double y;public: point(double a, double b { x=a; y=b; friend double distance (point a, point b ; };double distance(point a, point b return sqrt((a. x-b. x )*(a. x -b. x )+ (a. x -b. x)*(a. x-b. x));}int main (){ point p1 (1,2); point p2(5,2); cout<<distance (p1, p2)<<end1; return 0;} 程序运行后的输出结果是

A.1

B.5

C.4

D.6


正确答案:C
解析:本题考核友元函数的应用。分析程序:类point中定义了两个私有成员x和y,以及一个友元函数distance。从而,函数distance可以访问类point中的任何成员。在函数distance中,返回值为sqrt ((a. x- b. x)*(a. x-b. x)+(a. y-b. y)*(a. y-b. y))。由此可知,函数distance的功能是计算a、b两点之间的距离。在主函数main中,先定义两点:p1(1,2)和p2(5,2)。然后调用函数distance计算两点之间的距离为4,所以程序最后输出为4。

第6题:

下面程序的输出结果是()。includeincludeusing namespace std;class point{p

下面程序的输出结果是( )。 #include<iostream> #include<math.h> using namespace std; class point { private: double x; double y; public: point(double a,double b) { x=a; y=b; } friend double distances(point a,point b); }; double distances(point a,point b) { return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)); } int main() { point p1(1,2); point p2(5,2); cout<<distances(p1,p2)<<end1; return 0; }

A.2

B.4

C.8

D.16


正确答案:B
解析:分析题目,此题最终要实现的结果是sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)),其中的a.x和a.y分别指p1(1,2)中的1和2。这样容易得到结果是(1-5)*(1-5)+(2-2)*(2-2)=16,再开方得到结果为4。

第7题:

有以下程序:includeincludeusing namespace std; class point{private:double

有以下程序: #include<iostream> #include<math> using namespace std; class point { private: double x; double y; public: point(double a,double B) { x=a; y=b; } friend double distance (point a,point B) ;

A.1

B.5

C.4

D.6


正确答案:C
解析:本题考核友元函数的应用。分析程序:类point中定义了两个私有成员x和y,以及一个友元函数distance。从而,函数distance可以访问类point中的任何成员。在函数distance中,返回值为sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))。由此可知,函数distance的功能是计算a、b两点之间的距离。在主函数main中,先定义两点:p1(1,2)和p2(5,2)。然后调用函数distance计算两点之间的距离为4,所以程序最后输出为4。

第8题:

阅读下列C++程序和程序说明,将应填入(n)处的字句写在对应栏内。

【说明】Point是平面坐标系上的点类,Line是从Point派生出来的直线类。

include <iostream.h>

class Point

{public:

Point (int x, int y) ;

Point (Point &p) ;

~Point();

void set (double x, double y) ;

void print();

private:double X,Y;

};

Point::Point (int x, int y) //Point 构造函数

{X=x; Y=y; }

Point::Point ( (1) ) //Point 拷贝构造函数

{X=p.X; Y=p.Y;}

void Point::set (double x, double y)

{X=x; Y=y; }

void Point::print()

{cout<<' ('<<X<<","<<Y<<") "<<endl; }

Point::~Point()

{cout<<"Point 的析构函数被调用! "<<endl;

class Line: public Point

{public:

Line (int x, int y, int k) ;

Line (Line &s) ;

~Line();

void set (double x, double y, double k)

void print();

private:double K;

};

(2)//Line 构造函数实现

{ K=k;}

(3)//Line 拷贝构造函数实现

{K=s.K;}

void Line::set (double x, double y, double k)

{ (4);

K=k;

}

void Line::print()

{cout<<" 直线经过点";

(5);

cout<<"斜率为: k="<<K<<endl;

}

Line: :~Line()

{cout<<"Line 析构函数被调用! "<<endl;

}

void main()

{Line 11 (1,1,2) ;

11 .print();

Linel2 (11) ;

12.set (3,2,1) ;

12.print();

}


正确答案:(1)Point &p (2)Linc::Line(int xint y int k):Point(xy) (3)Line::Line(Line &s):Point(s) (4)Point::set(x y) (5)Point::print()
(1)Point &p (2)Linc::Line(int x,int y, int k):Point(x,y) (3)Line::Line(Line &s):Point(s) (4)Point::set(x, y) (5)Point::print() 解析:(1)Point &p
Point拷贝构造函数的形参必须是Point对象的引用。
(2)Linc::Line(int x,int y, int k):Point(x,y)
Line的构造函数必须先调用Point构造函数构造Line的基类Point。
(3)Line::Line(Line &s):Point(s)
Line的拷贝构造函数必须先调用Point拷贝构造函数来构造并复制Line对象的基类 Point部分。
(4)Point::set(x, y)
Line的set成员函数必须通过Point的set成员函数才能访问基类的私有成员。而且在 set名前必须加成员名限定Point::,以区别Line的set函数。
(5)Point::print()
Line的print成员函数必须通过Point的print成员函数才能访问打印基类的私有成员。而且在print名前必须加成员名限定Point::,以区别Line的print函数。

第9题:

A fishing vessel displaying the lights shown is ______.

A.anchored

B.underway but not fishing

C.tending a small fishing boat

D.fishing by trawling


正确答案:D

第10题:

A vessel engaged in minesweeping on the high seas carries which of the following day signals ?

A.Two green balls in a vertical line

B.Two black balls in a vertical line

C.A black ball at the foretruck and yardarm ends

D.A shape of two cones point to point


正确答案:C
一艘从事扫雷的船舶白天显示的信号是?在前桅顶和前桅桁悬挂黑球

更多相关问题