问题 选择题

如图所示,以下成语与其物理知识相符的是(    )

A.凿壁偷光——光的折射

B.井底之蛙——光的反射

C.猴子捞月——光的折射

D.杯弓蛇影——光的反射

答案

答案:D

题目分析:凿壁偷光、井底之蛙说明光沿直线传播。猴子捞月“水中月“是平面镜成像,是光的反射。杯弓蛇影是平面镜成像,是光的反射。

单项选择题 A1/A2型题
填空题

使用VC++6.0打开考生文件夹下的源程序文件3.cpp,其中定义了用于表示Et期的类Date,但类Date的定义并不完整,按要求完成下列操作,将类的定义补充完整。
(1)定义私有成员变量year、month、day,分别表示年、月、日,类型为int。请在注释1后添加适当的语句。
(2)完成构造函数,分别给year、month、day赋值,请在注释2后添加适当的语句。
(3)完成重载符号“+=”的定义,请在注释3后添加适当的语句。
(4)完成函数print打印函数,如2005年1月5日到屏幕和文件out3.txt格式相同,请在注释4后添加适当的语句。
注意:增加代码,或者修改代码的位置已经用符号表示出来。请不要修改其他的程序代码。
试题程序:
#include<iostream.h>
#include<fstream>
#include<iomanip>
#include<cmath>
using namespace std;
void WriteFile(int c)

ofstream out1;
out1.open("out3.txt",ios_base::app);
out1<<c<<’’;
out1.close();

void WriteFile(char *str)

ofstream out1;
out1.open("out3.txt",ios_base::app);
out1<<str;
out1.close();

void ClearFile()

ofstream out1;
out1.open("out3.txt");
out1.close();

class Date

public:
Date(int y,int m,int d)

//********1********

void print();
//********2********

month+=m;
int i=month/12;
int j=month%12;
if(j==0)

year+=(i-1);
month=12;

else

year+=i;
month=j;

return *this;

private:
//********3********

void Date::print()

//********4********
WriteFile(year);
WriteFile("年");
WriteFile(month);
WriteFile("月");
WriteFile(day);
WriteFile("日");

int main()

ClearFile();
Date National_day(2004,10,5);
National_day+=3;
National_day.print();
return 0;