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<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;
}
第2题:
下列程序的执行结果为【 】。
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)
}
第3题:
下面程序的输出结果是【 】。
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题:
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
第5题:
有以下程序:#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
第6题:
下面程序的输出结果是( )。 #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
第7题:
有以下程序: #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
第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();
}
第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
第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