问题 单项选择题

根据下面的程序,可以在主程序中使用的合法语句是( )。
#include <iostream>
using namespace std;
class Person
int age;
public:
void SetAge(int x)age=x;
void ShowAge()cout<<"the Person’s age is" <<age;

class Student:private Person
public:int study_code;

void main()
Student wangqiang;
wangqiang.study_code=23;

A.wangqiang.age=231

B.wangqiang.Setage(23)

C.wangqiang.ShowAge()

D.wangqiang.study_code=12

答案

参考答案:D

解析: 由于是私有继承,基类中所有成员成为派生类中的私有成员,故不能由派生类的对象访问,只有派生类的公有成员可由派生类对象访问。

完形填空
完形填空。
      Jimmy was unhappy. Jimmy's parents had just lived apart. They were coming for a    1    about his
poor schoolwork and bad behavior.
     Jimmy was the only child. He used to be    2    and was very good at his schoolwork. How could I
tell his father and mother about his poor grades?
     Jimmy's mother entered the room and sat down. Soon his father arrived. Good!    3    they came to
the meeting. They looked at    4    without any feeling.
     When I told them about Jimmy's    5    and schoolwork. I tried to use the right words. I wanted to
show them what they were doing to their    6   . But I don't know what to say. Perhaps they should see
one of Jimmy's carelessly done papers. 
     I found a crumpled (弄皱的) English paper in his desk. Some words were    7   on both sides of the
paper. But there was only one    8   . I gave it to Jimmy's mother. She read it and then, without a word,
handed it to her husband. He frowned (皱眉). He was    9   .
      Then he folded the paper carefully, placed it in his pocket, and reached for his wife's hand. She
wiped the   10   from her eyes and smiled up at him. My eyes were also full of tears. He helped her with
her coat and they left together.
     The words on the paper were, "Dear Mom Dear Daddy I love you I love you."
( )1. A. look   
(     )2. A. tall   
(     )3. A. At least
(     )4. A. the room
(     )5. A. name   
(     )6. A. teacher
( )7. A. found  
(     )8. A. sentence
( )9. A. saying 
( )10. A. them   
B. talk     
B. young    
B. At first 
B. the ground
B. look     
B. son      
B. shown    
B. word     
B. reading       
B. tears    
C. test    
C. happy   
C. At last 
C. me      
C. behavior
C. daughter
C. heard   
C. voice   
C. thinking
C. words       
D. interview 
D. lovely    
D. At once   
D. each other
D. questions 
D. family                          
D. spoken    
D. piece     
D. asking    
D. lights    
单项选择题