问题 单项选择题

在下面的程序代码中,a是全局变量。若以引用调用(call by reference)方式调用函数 f,则输出结果为 (1) ;若以值调用(call by value)方式调用函数f,输出结果为 (2)

(2)

A.10

B.40

C.36

D.72

答案

参考答案:B

解析: 传值调用是指将实际参数的值传递给形式参数,实际参数与形式参数对应的存储单元是相互独立的,实际参数仅为形式参数提供初始值,在被调用函数中对形式参数的修改与实际参数没有关系。题目中,实际参数a的值为5,传值调用时将5传递给形式参数x,a是全局变量,所以函数f中对a和x的引用是两个对象,如图6-4所示,函数的返回值为36。 引用调用时形式参数和实际参数对应的存储单元都是实参的单元,因此函数中对a和x的引用是同一个对象,如图6-5所示,函数的返回值为64。

阅读理解

Most recently, it's very common in students who need a parent present for job interviews. Naturally, it's easy to blame the students in these situations, but the bigger problem is us. We—as parents—are so eager to shelter our kids that we fail to realize that this in itself is harming them.As the mother of two young sons, I have to remind myself constantly that the biggest responsibility I have as a parent is to help them develop the skills needed to live in, to live without me.So, I'll let them fail.

I'll let them fail because as long as they are safe and warm inside their comfort zones, they will never grow.And failure is along with loss, heartbreak, disappointment, etc.—will be part of growth for them.Call me the anti-tiger mom, but leaving them alone  is my way of helping them become equipped to fit in this world as we know it today.From terrorism and seemingly endless natural disasters, to our national debt and beyond, if we expect the next generation to stand up to the very real problems of our time, we need to stop feeding them and start teaching them how to fish.

My children now are becoming little masters of compromise, but they try to negotiate (协商) everything now.It's a small price to help them learn a skill they'll use for the rest of their lives, including when I don't accompany them on job interviews.

小题1:Why do parents accompany their kids on job interviews?

A.Because they want to protect their kids from difficulties.

B.Because they think they can help them on the questions.

C.Because their kids are too shy to attend interviews.

D.Because their kids strongly request them to do so.小题2:According to the author, what is beneficial to kids' development?

A.Sheltering them.                      B.Keeping them safe.

C.Leaving them alone.                  C.Blaming them.

小题3:Why does the author stress failure in kids' life?

A.To make them stronger than other kids.

B.To help them grow in this tough world.

C.To help them develop all social skills.

D.To make them learn to compromise.小题4:Which of the following might be the best title for die text?

A.Never Shelter Your Kids

B.Let Your Kids Fail

C.Be Eager to Grow Up

D.Live Without Parents

多项选择题