问题 填空题
设S、V分别表示面积和体积,如△ABC面积用S△ABC表示,三棱锥O-ABC的体积用VO-ABC表示.对于命题:如果O是线段AB上一点,则|
OB
|•
OA
+|
OA
|•
OB
=
0
.将它类比到平面的情形是:若O是△ABC内一点,有S△OBC
OA
+S△OCA
OB
+S△OBA
OC
=
0
.将它类比到空间的情形应该是:若O是三棱锥A-BCD内一点,则有______.
答案

由平面图形的性质类比猜想空间几何体的性质,

一般的思路是:点到线,线到面,或是二维变三维,面积变体积;

由题目中点O在三角形ABC内,则有结论S△OBC

OA
+S△OAC
OB
+S△OAB
OC
=
0

我们可以推断VO-BCD

OA
+VO-ACD
OB
+VO-ABD
OC
+VO-ABC
OD
=
0

故答案为:VO-BCD

OA
+VO-ACD
OB
+VO-ABD
OC
+VO-ABC
OD
=
0

多项选择题 案例分析题
问答题

本题中,通过菜单“Connect”显示一个对话框,单击“ok”按钮后,所填写的内容就会传回到主窗口并显示出来。
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class java3 extends JFrame implements ActionListener
public java3()
setTitle("java3");
setSize(300,300);
addWindowListener(new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);

);
JMenuBar mbar=new JMenuBar();
setJMenuBar(bar);
JMenu fileMenu=new JMenu("File");
mbar.add(fileMenu);
connectItem=new JMenuItem("Connect");
connectItem.addActionListener(this);
fileMenu.add(connectItem);
exitItem=new JMenuItem("Exit");
exitItem.addActionListener(this);
fileMenu.add(exitItem);

public void actionPerformed(ActionEvent evt)
Object source=evt.getSource();
if(source==connectItem)
ConnectInfo transfer=new ConnectInfo("yourname","pw");
if(dialog==null)
dialog=new ConnectDialog(this);
if(dialog.showDialog(transfer))
String uname=transfer.username;
String pwd=transfer.password;
Container contentPane=getContentPane();
contentPane.add(new JLabel("username="+uname+",password="+pwd),"South");
validate();

else if(source==exitItem)
System.exit(0);

public static void main(String[]args)
JFrame f=new java3();
f.show();

private ConnectDialog dialog=null;
private JMenuItem connectItem;
private JMenuItem exitItem;

class ConnectInfo
public String username;
public String password;
public Connectfnfo(String u,String p)
username=u;password=p;


class ConnectDialog extends JDialog implements ActionListener
public ConnectDialog()
super(parent,"Connect",true);
Container contentPane=getContentPane();
JPanel p1=new JPanel();
p1.setLayout(new GridLayout(2,2));
p1.add(new JLabel("User name:"));
p1.add(username=new JTextField(""));
p1.add(new JLabel("Password:"));
p1.add(password=new JPasswordField(""));
contentPane.add("Center",p1);
Panel p2=new Panel();
okButton=addButton(p2,"Ok");
cancelButton=addButton(p2,"Cancel");
contentPane.add("South",p2);
setSize(240,120);

JButton addButton(Container c,String name)
JButton button=new JButton(name);
button.addActionListener(this);
c.add(button);
return button;

public void actionPerformed(ActionEvent evt)
Object source=evt.getSource();
if(source==okButton)
ok=true;
setVisible(false);

else if(source==cancelButton)
setVisible(false);

public void showDialog(ConnectInfo transfer)
username.setText(transfer.username);
password.setText(transfer.password);
ok=false;
show();
if(ok)
transfer.username=username.getText();
transfer.password=new String(password.getPassword());

return ok;

private JTextField username;
private JPasswordField password;
private boolean ok;
private JButton okButton;
private JButton cancelButton;