The desirable properties of a marine fuel oil should include .
A.high flash point and high viscosity
B.low flash point and high viscosity
C.low heating value and high sulphur content
D.high heating value and low sulphur content
第1题:
阅读下列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();
}
第2题:
有以下程序: #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
第3题:
A.On/On
B.On/Auto
C.Passive/Active
D.Desirable/Auto
E.Active/Active
F.Desirable/Desirable
第4题:
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。
[说明]
下面程序是为汽车市场编制的一个程序的一部分。其中automobile是基类。
[C++程序]
//Auto.h
ifndef AUTO_H
define AUTO_H
class automobile
{
(1):
int miles_per_gallon; //汽车每加仑行驶公里数
float fuel_capacity; //油箱容积
public:
void initialize(int in_mpg,int in_fuel);
int get_mpg(void);
float get_fuel(void);
float travel_distance(void);
}
endif
//Auto.cpp
include"auto.h"
void automobile::initialize(int in_mpg,float in fuel)
{
miles_per_gallon=in_mpg;
fuel_capacity=in_fuel;
)
int automobile::get_mpg() //提供一辆特定汽车每加仑公里数
{return miles per_gallon;}
float automobile::get_fuel() //提供油箱容积
{return fuel_capacity;}
float automobile::travel_distance()
{return (2) }
//car.h
ifndef CAR_H
define CAR_H
include"auto.h"
class car: (3)
{
int Total_doors;
public:
void initialize(int in_mpg,float in_fuel,int doors=4);
int doors(void);
};
endif
//car.cpp
include"car.h"
void car::initialize(int in_mpg,float in_fuel,int door)
{
Total_doors=door;
miles_per_galion=in_mpg;
fuel_capacity=in_fuel;
}
int car::doors(void)
{return Total doors;}
//Allauto.cpp
include
include"auto.h"
include"car.h"
int main()
{
car sedan;
sedan.initialize(24,20.0,4);
tout<<"The sedan can travel"<< (4) <<"miles.\n";
cout<<"The sedan has"<< (5) <<"doors.\n";
return 0;
}
第5题:
A.On-Passive
B.On-Auto
C.Passive-Active
D.Desirable-Auto
E.Active-Active
F.Desirable-Desirable
第6题:
Category 2 fuel _____________________