问题 单项选择题

下面类的声明中的几个语句,正确的是(设定语句是主函数中的语句)( )。 class TestClass { private: int data; public: TestClass(int g_data) { data=g_data; } void show(){cout<<data<<end1;) };

A.TestClass *p;

B.TestClass m;

C.TestClass.data=8;

D.TestClass.show();

答案

参考答案:A

解析: C++中,若没有类的显式声明构造函数则系统会为其提供一个默认的构造函数,若提供了构造函数则会将系统提供的默认的构造函数覆盖。调用构造函数时,实参必须与形参匹配。但是如果声明一个对象指针时,不是定义一个对象,不调用对象的构造函数。

完形填空
信息归纳 (本部分共5小题,每小题1分,共5分)
Scientists who study the climate (气候) are still arguing about how fast the earth is warming and how much it will warm, but they do agree that the earth is warming and that it will keep warming if we don’t do anything about it.
Scientists agree that the burning of fossil fuels (化石燃料) like oil and coal cause greenhouse gases to escape (释放) into the air and that these gases are causing most of the warming. Another cause is deforestation ( cutting down trees ) . Trees soak up carbon dioxide  (二氧化碳) , one of the greenhouse gases, from the air.
There are already some changes happening because of global warming. Sea level is rising and some animals are already moving to new homes. It’s already too late to stop global warming completely.
If the warming gets worse, as scientists expect, there may be some kinds of plants and animals that become extinct (灭绝的) because they can’t move to new homes. There may be more storms and floods. Sea level may rise so much that people have to move away from the coasts. Some areas may become too dry for farming.
Global warming is a very difficult problem to fix. People are having a hard time agreeing on what to do about it. For example, everyone agrees that wasting energy is a bad thing to do. But some people think that the federal government (联邦政府) should make laws about it, while other people think it should be up to each person or business to decide what to do.
Many states and businesses in the United States are not waiting until the federal government decides what to do. They have already started working on the problem.
根据短文内容,完成下面表格中的信息。每空词数不限。
Global warming
Causes
1. ______                 __  ;
2. _______                _  ; 
Possible results
3. _______                 _  .
Plants and animals become distinct.
4. _____             _   __  .
People move away from coasts.
Some areas become too dry for farming.
What to do
5. _______                _  .
 
单项选择题 共用题干题