问题 单项选择题

以下程序计算1+1/3+1/5+…+1/(2N+1),直至1/(2N+1)小于0.00001,横线处应补充的程序是______。
public class Sun
public static void main(String args[])
int n=1;
double term. sum=1.0;
do
n=______;
term=1.0/n;
sum=sum+term;

while(term>=0.00001);
System. out. println(n);
System. out. println(sum);

A.2n
B.2n+1
C.2*n
D.2*n+1

答案

参考答案:D

解析: 本题考查do-while循环的用法。题目中没有给出累加次数,故不能使用for循环,在do循环中,由累加项term的值作为退出循环的条件。根据题目要求,应该填写2*n+1。本题的关键是while(term>=0.00001)语句,题目要求计算直至1/(2N+1)小于0.00001,所以term=1/(2N+1),因此n=2*n+1。

填空题

Part 2


Questions 9-18


Read the following passage and answer questions 9-18.
1. Most young people enjoy some forms of physical activity. It may be walking, cycling or swimming, or in winter, skating or skiing. It may be a game of some kind football, golf, or tennis. It may be mountaineering.
2. Those who have a passion for climbing high difficult mountains are often looked upon with astonishment. Why are men and women willing to suffer cold and hardship, and to take risks on high mountains This astonishment is caused probably by the difference between mountaineers and other forms of activity to which men give their leisure.
3. Mountaineering is a sport and not a game. There are no man-made rules, as there are for such games as golf and football. There are, of course, rules of a different kind which would be dangerous to ignore, but it is this freedom from man-made rules that makes mountaineering attractive to many people. Those who climb mountains are free to use their own methods.
4. If we compare mountaineering with other more familiar sports, we might think that one big difference is that mountaineering is not a "team game". We should be mistaken in this. There are, it is true, no "matches" between "team" of climbers, but when climbers on rock face linked by a rope on which their lives may depend, there is obviously teamwork.
5. The mountain climber knows that he may have fight forces that are per and more powerful than man. He has to fight to against the forces of nature. His sport requires high mental and physical qualities. A mountain climber continues to improve in skill year after year. A skier is probably past his best by the age of thirty, and most international tennis champions are in their early twenties. But it is not unusual for a man of fifty or sixty to climb the highest mountains in the Alps. They may take more time than young man, but they probably climb with more skill and less waste of effort, and they certainly experience equal enjoyment.

Questions 9-13


·For questions 9-13. choose the best title for each paragraph from below.
·For each numberedparagraph (1-5), mark one letter (A-G) on the Answer Sheet..
·Do not mark any letter twice.
  • A. Mountaineering is different from golf and football.
  • B. Mountaineering is treated as a team sport.
  • C. The requirements needed for climbers.
  • D. Many young people enjoy some forms of physical activity.
  • E. A mountain climber’s skill is not limited by his age.
  • F. The reason why people enjoy climbing mountains.
  • G. Mountaineering is a sport rather than a gam

Paragraph 4: ______

单项选择题