今天累惨了,先把代码放上 后天再更
import javax.swing.*;
import java.text.DecimalFormat;
import java.awt.event.*;
public class BinaryEquation{
JFrame frame;
JLabel label1, label2, label3, label4,rightanswer1,rightanswer2,label5,label6;
JTextField slope5 = new JTextField(10);
JTextField slope6 = new JTextField(10);
JButton compare;
long userx, usery;
String y;
String x;
public static void main (String[] args)
{
BinaryEquation gui = new BinaryEquation();
//set parameters
int a = 1, b = 2, c = 3, d = 4;
a = (int) (Math.random()*101);
b = (int) (Math.random()*101);
c = (int) (Math.random()*101);
d = (int) (Math.random()*101);
gui.go(a,b,c,d);
}
public void go(int a,int b,int c,int d)
{
QuadricEquation equa1 = new QuadricEquation();
QuadricEquation equa2 = new QuadricEquation();
equa1.SetParameters(a, b);
equa2.SetParameters(c, d);
//solve the equations to get