问题 填空题

使用VC6打开考生文件夹下的工程test4_1,此工程包含一个源程序文件test4_1.cpp,但该程序在类的定义中存在问题,请改正类定义中的错误,使程序的输出结果如下: a=3 b=13 a=5 b=13 注意:请勿修改主函数main中的任何内容。 源程序文件rcst4_1.cpp清单如下: #include<iostream.h> class T { public: /*********found***+******/ T(int x){a=x; b+=x;) /+********found**********/ void display(T c) { cout<<"a="<<c.a<<"\t"<<"b="<<c.b<<endl;) private: const int a; static int b; }; /**********found*********/ int b=5; void main() { T A(3),B(5); T::display(A); T::display(B); }

答案

参考答案:

解析:(1)错误:T(int x){a=x;b+=x;) 正确:T(int x):a(x){b+=x;) (2)错误:void display(T c) 正确:static void display(T c) (3)错误:int b=5; 正确:int T::b=5; (1)主要考查考生对常量数据成员初始化方法的掌握,常量数据成员的初始化只能通过构造函数的成员初始化列表进行,常量数据成员使用关键字const修饰; (2)主要考查考生对静态成员函数的理解,由主函数中的T::display(A)与T::display(B)可知display应定义为静态成员函数,因为调用类的静态成员必须使用作用域“::”符号; (3)主要考查考生对静态数据成员初始化方法的掌握,由static int b可知b为静态成员数据,其初始化必须在类外使用作用域运算符(::)限定它所属的类。

阅读理解

What separates me from everyone else? The difference is not what clothes I wear or the music I listen to, but what I feel inside.

Ever since I was young, I have loved professional wrestling(摔跤). I woke up every Saturday to watch my favorite "Superstars." As I grew older, I got a lot of flak for watching this "fake" sport. My peers(同龄人) would laugh at me for following what was called a "man's soap opera." So, I put my love for wrestling on the shelf. Like everyone else, I wanted to be associated with the cool clique. I yearned to be invited to the parties of the in-crowd and hang out with the popular kids. I became pretty successful. Although my Friday evenings were busy with parties, I would still wake up early Saturdays to watch wrestling. It wasn't until freshman year that I realized I wasn't being myself.

That year, I tried many new things and activities and made new friends. In my town, football was the sport, so I decided to play football, thinking it might give me a head start in popularity. The team started with 48 athletes. At the end, there were 14 of us left. I stuck it out not because I liked it, but because I am not a quitter. That long season taught me a lesson: I wasn't a football player. More importantly, it taught me to be myself.

After that season, I went back to being a wrestling fan. I watched it religiously, no matter what insults were thrown my way. I came across a quote: "Don't Dream It, Be It." When I read this, my friend Dan had the same idea I had.

"What if we build a wrestling ring(拳击场)?" we asked. We acquired the necessary wood and equipment for its construction. The following weekend, we met at his house. We saw our dream in a pile in his backyard. We worked from dawn to dusk to build our great establishment. By Sunday night, our mission was complete. Our hard work (combined with a little creativity) had paid off. We had a real ring. We decided to hold an "event." We practiced for hours, trying to improve every aspect of our wrestling ability. The date was May 24th. Our show had a start time of 9: 00 p.m. To our surprise, about one hundred family, friends and fans showed up to support us. It was the most important night of my life and a complete success. Since that time, we have held five shows with as many as two hundred and fifty people turning out. We continue to live this dream. We accomplished what we set out to do. We are now well known throughout school. When I walk down the halls, I am respected by my peers. Some are the same peers who ridiculed me for watching wrestling when I was younger. When they approach me, they often say, "Good match, Chris." I humbly say, "Thank you," knowing I did something I believed in.

As my senior year winds down, I'll remember all of my high school memories. But what will stick out most is the memory that I did something I loved, despite what everyone said or thought. I accomplished my goal. I lived my dream.

小题1:What makes the writer different from the others is __________.

A.the different sports he loves

B.the different clothes he wears and the different music he listens to

C.that he is younger than the others.

D.the different ideas he has小题2:What does the underlined sentence in Paragraph 2 mean?

A.I practiced wrestling secretly in my spare time.

B.I put the clothes for wrestling on the shelf.

C.I decided to quit following wrestling.

D.I began not to watch wrestling on TV.小题3:When the writer was a freshman, he ___________.

A.knew he couldn’t be a good football player

B.realized he was being himself

C.was still sociable

D.built a wrestling ring小题4:The writer built the wrestling ring in order to ________.

A.play football there

B.make his dream realized

C.be a professional player

D.have parties there.小题5:What is the writer’s attitude towards his experience in high school?

A.Optimistic

B.Pessimistic

C.Doubtful

D.Surprised

单项选择题