问题 听力题

小题1:It wasn’t very  _____ (有礼貌的)of you to serve yourself without asking.

小题2:Smoking is not  _____ (允许)in this restaurant.

小题3:Is the fire still  _____ (燃烧)?

小题4: Thanks to the policy, which the government is sending home-electric machines to farmers, they can pay much            (少的) money.

小题5:What was the most important            (发明) in the 20th century.

小题6:After Jim answered the phone, he rushed out of the house   _____   (立即).

小题7:English dictionaries are very    ___   (use) to you when you study English.

小题8:I want to have the bike very much. But I can’t a          it.

小题9:The dresses_________ (本身) are made of common materials, but they sell well because of the famous designer.

小题10:He seldom__________ (回复) to the e-mails his friends send him.

答案

多项选择题
填空题

请完善程序(程序文件名:Java_3.java)并进行调试。请在下画线处填入正确内容,然后删除下画线。请勿删除注释行和其他已有的语句内容。
题目要求:
下面是整数除法计算的程序,要求在出现异常时能抛出异常信息。
需要考虑两种异常:
①输入非数字除数;
②输入除法分母为零。
该程序运行的3种结果状态如下。
(1)输入两个合法整数时,运行结果如下图所示。


(2)输入非数字除数时,运行结果如下图所示。


(3)输入除数为零时,运行结果如下图所示。


源程序:
import java.text.DecimalFormat;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Java_3 extends (1) implements ActionListener
private JTextField input1, input2, output;
private int number1, number2;
private double result;
//初始化
public Java_3()
(2) ("示范异常");
Container c=getContentPane();
c.setLayout(new GridLayout(3, 2));
c.add(new JLabel("输入分子", SwingConstants.RIGHT));
input1=new JTextField(10);
c.add(input1);
c.add(new JLabel("输入分母和回车", SwingConstants.RIGHT));
input2=new JTextField(10);
c.add(input2);
input2.addAetionListener(this);
c.add(new JLabel("计算结果", SwingConstants.RIGHT));
output=new JTextField();
c.add(output);
setSize(425, 100);
show();

//处理GUI事件
public void actionPerformed(ActionEvent e)
DeeimalFormat precision3=new DecimalFormat("0.000");
output.setText(""); //空的JTextField输出
(3)
number1=Integer.parseInt(input1.getText());
number2=Integer.parseInt(input2.getText());
result=quotient(number1, number2);
output.setText( (4) );
catch(NumberFormaLException nfe)
JOptionPane.showMessageDialog(this, "你必须输入两个整数", "非法数字格式" , JOptionPane.ERROR_MESSAGE);
catch(Exception dbze)
(5) (this, "除法异常" , "除数为零" , JOptionPane. ERROR_MESSAGE);


//定义求商的方法,如遇除数为零时,能抛出异常
public double quotient(int numerator, int denominator)
throws Exception
if(denominator==0)throw new Exception();
return(double)numerator/denominator;

public static void main(String args[])
Java_3 app=new Java_3();
app.addWindowListener(new windowAdapter()
public void windowClosing(WindowEvent e)
e.getWindow().dispose();
System.exit(0);


);


/*JOptionPane类的常用静态方法如下:
showInputDialog()
showConfirmDialog()
showMessageDialog()
showoptionDialog()
*/