船舶水手考试

Double full astern.()A、全速后退B、再后退三C、半速后退D、后退三

题目

Double full astern.()

  • A、全速后退
  • B、再后退三
  • C、半速后退
  • D、后退三
如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

编写求两个双精度数之和的函数,选项中正确的是

A.double add(double a,double b)

{double s;

s=a+b;

return s; }

B.double add(double a,b)

{double s;

s=a+b;

return (s);}

C.double add(double a double b)

{double s;

s=a+b;

returns;}

D.double add(a,b)

{double a,b,s;

s=a+b;

return (s);}


正确答案:A

第2题:

My ship’s engine responds well to telegraph orders and takes about 80 seconds to reverse from full speed ahead to full speed astern. This sentence ______.

A.indicates the engine’s particulars

B.tells the engine’s function

C.shows the engine’s type

D.refers to the engine’s information


正确答案:A
我船主机车钟响应很好并且自全速进车到全速倒车反转主机大约为80秒。这个句子显示了主机的特点。

第3题:

以下选项中正确的定义语句是

A)double a;b;

B)double a=b=7;

C)double a=7,b=7;

D)double,a,b;


正确答案:C

第4题:

以下选项中正确的定义语句是______。

A.double a;b;

B.double.a=b=7;

C.double a=7,b=7;

D.double,a,b;


正确答案:C
解析:C语言规定,每个语句和数据定义以分号结束,则说明选项A是两条语句,前—条是对变量a作双精度型定义的语句,而后一个“b;”是一个缺少类型的不正确的定义形式,如果是定义多个变量,则应用逗号隔开;当定义多个变量赋同—个值时,不能用等式连写的方式,如选项B的“double a=b=7;”应写成“double a=7,b=7;”所以选项B错误,选项C正确;在定义语句时,类型与变量名之间应用空格分隔,而不是逗号,所以选项D错误。

第5题:

Double full astern.

A.全速后退。

B.再后退三。

C.半速后退。

D.后退三。


正确答案:B

第6题:

●试题五

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

【说明】

①在类体中添加函数move(double ax, double ay)的定义,使得点的坐标x和y分别移动ax和ay个单位。

②在类定义外完成重载的两个构造函数CPosition()和CPosition(double dx, double dy),其中前者为不带参数的构造函数,使CPosition对象的默认值为x=0,y=0,后者为带参数的构造函数,把数据成员x和y分别初始化为参数dx和dy的值。

③完成函数double distance(double bx, double by)的定义,该函数返回*this和点(bx,by)的距离。

注意:除在指定的位置添加语句外,请不要改动程序中的其他语句。

源程序文件test5.cpp清单如下:

#include<iostream.h>

#include <math.h>

class CPosition

{

public:

CPosition();

CPosition(double dx, double dy);

double getx();

double gety();

(1)

double distance(double bx, double by);

private:

double x;

double y;

};

(2)

{

x=0; y=0;

}

CPosition::CPosition(double dx, double dy)

{

x=dx; y=dy;

}

double CPosition::getx()

{

return x;

}

double CPosition::gety()

{

return y;

}

double CPosition::distance(double bx, double by)

{

(3)

}

void main()

{

double a,b;

cout << "Input x, y position of a point: ";

cin >> a >> b;

CPosition psA(a, b);

cout << "Input x, y position of another point: ";

cin >> a >> b;

cout << "The distance is " << psA.distance(a,b) <<endl;

}


正确答案:

●试题五

【答案】(1void move(double ax, double ay){x += ax;y += ay;};

2CPosition::CPosition()3return sqrt(pow(x-bx, 2) + pow(y-by, 2));

【解析】本题主要考查考生对于类的定义和重载构造函数的掌握情况。在(3)中使用了基本的数学函数sqrt(x)x的开方,pow(x,n)函数是求xn次方。

 

第7题:

紧急后退三。

A.Full astern!

B.Double full astern!

C.Emergency full astern!

D.Emergency three astern!


正确答案:C

第8题:

若程序中定义了以下函数:double myadd(double a,double b){ return(a+b);}并将其放在调用语句之后,则在调用之前应该对该函数进行说明,以下选项中错误的说明是( )。A.double myadd(double a, b)B.double myadd(double ,double )C.double myadd(double b,double a)D.double myadd(double x,double y)


正确答案:A
当函数的调用在函数的定义之前时,需要对函数做一个说明,说明的格式为:返回值类型名 函数名 (类型名 形参,类型名 形参);形参的名称可以任意,也可以省略,但是类型名不能省。

第9题:

下列程序的执行结果为【 】。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。

第10题:

有以下程序: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。

更多相关问题