问题 问答题

使用VC++6.0打开考生文件夹下的源程序文件3.cpp,其中定义了用于表示矩形的CRect类,但类CRect的定义并不完整。请按要求完成下列操作,将类CRect的定义补充完整。
(1)定义私有数据成员leftPoint、topPoint、rightPoint、bottomPoint,分别用于表示矩形左上角及右下角的点的坐标,它们都是double型的数据。请在注释1之后添加适当的语句。
(2)完成默认构造函数CRect的定义,指定默认实参为0,它们都是double型的数据。请在注释2之后添加适当的语句。
(3)定义函数体为空的析构函数。请在注释3之后添加适当的语句。
(4)在main函数中定义CRect类的实例rect2,并把reetl的值赋给rect2。请在注释4之后添加适当的语句。
注意:除在指定位置添加语句之外,不要改动程序中的其他内容。
试题程序:
#include<iostream.h>
class CRect

private:
//********1********
public:
//********2********
//********3********
void SetPoints(double,double,double,double);
void SetLeftPoint(double m)leftPoint=m;
void SetRightPoint(double m)rightPoint=m;
void SetTopPoint(double m)topPoint=m;
void SetBottomPoint(double m)hottomPoint=m;
void Display();

CRect::CRect(double l,double t,double r,double b)

leftPoint=1;topPoint=t;
rightPoint=r;bottomPoint=b;

void CRect::SetPoints(double l,double t,double r,double b)

leftPoint=l;topPoint=t;
rightPoint=r;bottomPoint=b;

void CRect::Display()

cout<<"left-top point is("<<leftPoint<<","<<topPoint<<")"<<’n’;
cout<<"right-bottom point is("<<rightPoint<<","<<bottomPoint<<")"<<’\n’;

void main()

CRect rect0;
rect0.Display();
rect0.SetPoints(20,20.6,30,40);
rect0.Display();
CRect rect1(0,0,150,150);
rect1.SetTopPoint(10.5);
rect1.SetLeftPoint(10.5);
//********4********
rect2.Display();

答案

参考答案:应添加“double leftPoint,topPoint,rightPoint,bottomPoint;”。

单项选择题
完形填空

II. 语言知识及应用(共两节,满分35分)

第一节:完形填空(共10小题;每小题2分,满分20分)

阅读下面短文,掌握其大意,然后从21-35各题所给的四个选项(A、B、C 和D)中,选出最佳选项,并在答题卡上将该项涂黑。

You need to know when the events of a text take place. This will help you to see the __21__ of the text — the reason things happen in a certain order. Some texts   22   a period of many years, like Wuthering Heights. Others go through a __23__ period of time — many poems try to capture one moment in time. Narrators (讲述者) can be immediate eyewitness, or they may be __24     the past. Some texts present two views of events: an eyewitness version, and a second version, __25__ on the same events much later. This happens in Great Expectations, where the narrator, Pip, sometimes speaks and acts like a __26__, and sometimes like a mature adult. Look out for the __27__ that the events fit together, and how they are caused. This is called the plot—the story of the text. Action in a text is either__28__, or happens by chance. Take notes on how the action is described, eg. if the tone is angry or __29__ . Try to work out how the language of the passage is being used to create the tone, the characters and the descriptions. You should also ask why the text has been written in the way it has — your notes on who, what, when, where and how will help you to    30    your own conclusions.

21. A. structure                    B. content                     C. character                  D. substance

22. A. contain               B. discover                C. cover                         D. hold

23. A. hard                         B. difficult                   C. long                        D. short

24. A. looking forward to      B. looking out for     C. looking back on       D. looking after

25. A. relaying                    B. including             C. writing                  D. reflecting

26. A. boy                         B. child                     C. girl                         D. student

27. A. way                          B. time                        C. place                   D. action

28. A. accurate                    B. considerate              C. desperate             D. deliberate

29. A. wonderful                  B. joyful                      C. thankful                   D. painful

30. A. hit                     B. come                   C. draw                 D. find