问题 单项选择题

下列程序中,若从键盘中输入的是大写字母C,则程序输出的结果是 import java.io.*; public class Exam{ public static void main(String args[])int ch=0;System.out.println(”输入一个字符:”);try{ ch=System.in.read(); char ch_A=’A’,ch_Z=’Z’,; int delta_c=(int)ch_A+(int)ch_Z-ch; System.out.println(”编码后的字符为:”+(char)delta_c); } catch(IOException e){ e.printStackTrace(); }} }

A.C

B.Y

C.X

D.字母C的ASCII码的整型值

答案

参考答案:C

解析: 本题考查考生阅读Java程序的能力。当使用ch=System.in.read()语句从键盘读入大写字母C赋给ch,此时ch值为67,也就是字母C的ASCII值。语句(int)ch A +(int)ch_Z-ch结果为88,ASCII码中的88相当于字母X,所以输出为X,选项C正确。

阅读理解

“Teenager” means a person from 13 to 19 years old. Although they’re young, they have to make many important choices by themselves. Often teachers and parents cannot handle them because they don’t understand and know teenagers, especially their wishes, problems or different moods in a short time. They need to think about questions like these: Should we go to college? What kind of job do I want? However, other people also influence their choices. Who influences teenagers?

It depends on the kind of choice. When teenagers buy things, friends are the most important influence. This is especially true for clothes and music. TV shows, advertisements and parents also influence teenagers. In more serious things, parents are probably the most important influence. Some teenagers say it’s best to regard both parents and friends as influences. James, a seventeen-year-old boy says he’s “just a crazy man”. He also says, “Parents are really important because they can tell you what’s right and wrong.”

But teenagers also feel they need to make choices—to make their own mistakes. As one teenager girl said, “If our parents don’t let us make our own choices, maybe in the future we don’t know how to do it.” And they feel friends can often be a big help, especially because friends sometimes know more about their situation than their parents.

小题1: Why do teenagers sometimes have to make their own choices?

Because the teachers want them to do it.

Because their parents want them to do it.

Because teenagers like to make choices by themselves.

Because teachers and parents don’t understand them well.

小题2: Who influences most to the teenagers when they buy music?

A.Their teachers.

B.Theirs parents.

C.Their friends.

D.Movie stars.小题3: What does the passage mainly talk about?

Everybody needs to make choices.

Teenagers need to make choices by themselves.

Teenagers know more about TV shows and music.

Teachers and parents should help teenagers as much as possible.

问答题 简答题