对
错
第1题:
此题为判断题(对,错)。
第2题:
此题为判断题(对,错)。
第3题:
有以下程序: Class Date { public: Date(int y,int m,mt d); { year=y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date &D) { year=d.year; month=d.month; day=d.day; } Void prin
A.2
B.3
C.4
D.5
第4题:
在VFP的命令窗口中进行日期的设置,要求以MM-DD-YY形式显示日期“11-15- 05”,应使用命令(57)。
A.SET DATE TO MDY ? DATE()&&显示"11-15-05"
B.SET DATE TO MDY DATE( )&& ,显示" 11 - 15 -05"
C.SET DATE TO MDY ? DATE( )显示" 11 - 15 -05"
D.SET DATE TO MDY ? DATE( )显示" 11 - 15 - 05"
第5题:
为了使程序的输出的正确结果为: Now is 2004.7.10 10:10:10. 那么应在下列程序划线处填入的正确语句是( )。 那么应在下列程序划线处填入的正确语句是( )。 #include <iostream> using namespace std; class TIME; class DATE { public: DATE(int y=2004,int m=1,int d=1) { year=y; month=m; day=d; } friend void DateTime(DATE &d, TIME &t); private: int year, month, day; }; class TIME { public: TIME(iht h=0, int m=0,int s=0) { hour=h; minute=m; second=s; } friend void DateTime(DATE &d,TIME &t); private: int hour,minute, second; }; ______________________ //函数 DateTime 的首部 { cout<<"Now is"<<d.year<<'.'<<d.month<<'.'<<d.day<< ' '<<t.hour<<":"<<t.minute<<':'<<t.second<<'.'<<end1; } int main ( ) { DATE d(2004,7,10); TIME t(10, 10, 10); DateTime(d,t); return 0; }
A.void DateTime(DATE &d,TIME &t)
B.void TIME::DateTime(DATE &d,TIME &t) const
C.friend void DateTime(DATE &d,TIME &t)
D.void DATE::DateTime(DATE &d,TIME &t)
第6题:
A、其中有错误
B、08/03/2001
C、2002
D、2001
第7题:
窗体中有命令按钮Commandl,事件过程如下:
PublicFunction f(x As Integer)As Integer
Dim Y AsInteger
X=20
y=2
f= X *Y
End Function
PrivateSub Commandl_Click( )
Dim y As Integer
static x As Integer
x=10
y=5
y=f(x)
Debug.Print x;y
End Sub
运行程序,单击命令按钮,则立即窗口中显示的内容是( )
A.10;5
B.10;40
C.20;5
D.20;40
第8题:
有以下程序:
class Date
{
public:
Date(int y,int m,int d);
{
year=y;
month=m
day=d;
}
Date(int y=2000)
{
year=y;
month=10;
day=1;
}
Date(Date &d)
{
year=d.year;
month=d.month;
day=d.day;
}
void print( )
{
cout<<year<<"."<<month<<"."<<day<<endl;
}
private:
int year,month,day;
};
Date fun(Date d)
{
Date temp;
temp=d;
return temp;
}
int main( )
{
Date datel(2000,1,1),date2(0,0,0);
Date date3(datel);
date2=fun(date3);
return 0;
}
程序执行时,Date类的拷贝构造函数被调用的次数是
A.2
B.3
C.4
D.5
第9题:
有以下程序: class Date { public: Date(int y,int m,int D) ; { year =y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date &D) { year=d.year; month=d.month; day=d.day; } void print () { cout<<year<<"."<<month<<"."<<day<<end1; } private: int year,month,day; }; Date fun(Date D) { Date temp; temp=d; return temp; } int main() { Date date1(2000,1,1),date2(0,0,0); Date date3(date1); date2=fun(date3); return 0; } 程序执行时,Date类的拷贝构造函数被调用的次数是
A.2
B.3
C.4
D.5
第10题:
在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Pnvate Sub Command1_Click() Dim x As Integer,y As Integer,t As Integer x=10:y=20:t=0 If x=y Then t=x:x=y:y=t Print x;y End Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。
A.10 20
B.20 0
C.20 10
D.20 20