急!急!急!寻找Java高手帮忙啊~~在线等~急啊

这是我们的课程设计,我做的报告被退下来了,希望高手帮帮我。帮我编一下程序,拜托了~~~~~~满意我会再追加分的。。先谢谢各位了。我在线等。

程序一:Java程序基本语法程序设计类题型
编辑程序要求参数 A B c 由键盘输入。即先打印“本程序求方程AX^2+BX+C=0的根!”,然后依次提示“请输入参数A:”、“请输入参数B:”、“请输入参数 C:”,最后计算结果。
程序二:Java面向对象思想和类的基本特性类题型
创建 5 个学生对象给一个学生数组赋值,每个学生属性有:学号、姓名、年龄。
(1)将学生按学号排序输出;
(2)给所有学生年龄加 1;
(3)统计大于 20岁的学生人数。
程序三:Java图形用户设计类或面向网络类题型
编辑一个小程序,界面上加入一个标签,显示内容为你的姓名和班级,
并注明是 X 月 XX 日作业,在标签下面增加列表、两个单选框(控制列表是否为多选状态),一个文本框,三个按钮,分别控制将文本框的内容加入列表、 删除、 删除全部列表内容, 当选择列表时, 按照当前状态 (是否多选),在文本框中显示用户选择的列表内容。再加入一个文本区,用来显示用户操作的过程,比如:您输入了文字 XXX,您单击了加入按钮等。

程序一:Java程序基本语法程序设计类题型
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Calculator {
public static void main(String []args){
String str = "";
int a, b, c;
System.out.println("本程序求方程AX^2+BX+C=0的根!");
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
try {
System.out.println("请输入参数A:");
str = buf.readLine();
a = Integer.parseInt(str);
System.out.println("请输入参数B:");
str = buf.readLine();
b = Integer.parseInt(str);
System.out.println("请输入参数C:");
str = buf.readLine();
c = Integer.parseInt(str);
System.out.println("输入算式为:"+ a + "X^2+" + b + "X+" + c + "=0");
Cal(a, b, c);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void Cal(int a, int b, int c){
int i = b*b - 4 * a * c;
/*两个根*/
if (i > 0) {
double X1 = (-(a*b) + Math.pow(i, 0.5)) / (2 * a);
double X2 = (-(a*b) - Math.pow(i, 0.5)) / (2 * a);
System.out.println("有两个根,分别是:" + X1 + ", " + X2);
}
/*一个根*/
else if (i == 0) {
double X1 = -(a*b) / (2 * a);
System.out.println("有一个根是:" + X1);

}
/*没有根*/
else{
System.out.println("没有根");
}
}
}
程序二:Java面向对象思想和类的基本特性类题型

public class Students {
public static void main(String [] args){
Student []students = new Student[5];
students[0] = new Student(200493051L, "张三", 21);
students[1] = new Student(200493055L, "李四", 18);
students[2] = new Student(200493067L, "王五", 19);
students[3] = new Student(200493065L, "找六", 22);
students[4] = new Student(200493048L, "宋七", 20);
/*将学生按学号排序输出*/
for(int i = 0; i < 5; i++){
for(int j = 0; j < 5 - i - 1; j++){
if(students[j].getStuNum() > students[j + 1].getStuNum()){
Student tmp = new Student();
tmp = students[j];
students[j] = students[j + 1];
students[j + 1] = tmp;
}
}
}
for(int i = 0; i < 5; i++){
students[i].printThis();
}
/*给所有学生年龄加 1*/
for(int i = 0; i < 5; i++){
students[i].setStuAge(students[i].getStuAge() + 1);
}
/*统计大于 20岁的学生人数*/
int count = 0;
for(int i = 0; i < 5; i++){
if (students[i].getStuAge() > 20)
count++;
}
System.out.println("年龄大于20的学生数为: " + count);
}
}
class Student{
private Long StuNum = 0l;
private String StuName = "";
private int StuAge = 0;
public Student(){}
public Student(Long stuNum, String stuName, int stuAge){
this.StuAge = stuAge;
this.StuNum = stuNum;
this.StuName = stuName;
}
public void setStuNum(Long stuNum){
this.StuNum = stuNum;
}
public void setStuName(String stuName){
this.StuName = stuName;
}
public void setStuAge(int stuAge){
this.StuAge = stuAge;
}
public int getStuAge(){
return this.StuAge;
}
public String getStuName(){
return this.StuName;
}
public Long getStuNum(){
return this.StuNum;
}
public void printThis(){
System.out.println("学生 : " + StuName + " 学号 :" + StuNum + " 年龄:" + StuAge);
}
}
程序三:Java图形用户设计类或面向网络类题型
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;

public class JavaApp {
public static void main(String []args) {
MyFrame mf = new MyFrame();
}
}

class MyFrame extends JFrame implements ActionListener, MouseListener{
private JLabel myInfo = new JLabel("张三 0102班");
private DefaultListModel dlm = new DefaultListModel();
private JList wordList = new JList(dlm);
private JRadioButton r1 = new JRadioButton("单选");
private JRadioButton r2 = new JRadioButton("多选");
private ButtonGroup bg = new ButtonGroup();
private JButton insert = new JButton("插入");
private JButton delete = new JButton("删除");
private JButton deleteAll = new JButton("删除所有");
private JTextArea text1 = new JTextArea ();
private JTextArea text2 = new JTextArea ();
public MyFrame(){
this.setSize(400, 300);
this.setLayout(null);
wordList.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION);
r1.setSelected(true);
JScrollPane scrollPane = new JScrollPane(wordList);
scrollPane.setSize(80,150);
scrollPane.setLocation(10, 50);
myInfo.setSize(100, 30);
myInfo.setLocation(10, 10);
bg.add(r1);
bg.add(r2);
r1.setSize(100, 30);
r1.setLocation(100, 50);
r2.setSize(100, 30);
r2.setLocation(100, 80);
insert.setSize(80, 30);
insert.setLocation(100, 120);
delete.setSize(80, 30);
delete.setLocation(200, 120);
deleteAll.setSize(100, 30);
deleteAll.setLocation(290, 120);
JScrollPane scrollPane1 = new JScrollPane(text1);
JScrollPane scrollPane2 = new JScrollPane(text2);
scrollPane1.setSize(260, 40);
scrollPane1.setLocation(100, 160);
scrollPane2.setSize(350, 60);
scrollPane2.setLocation(10, 200);

insert.addActionListener(this);
delete.addActionListener(this);
deleteAll.addActionListener(this);
wordList.addMouseListener(this);
r1.addMouseListener(this);
r2.addMouseListener(this);

this.add(scrollPane);
this.add(scrollPane1);
this.add(scrollPane2);
this.add(myInfo);
this.add(r1);
this.add(r2);
this.add(insert);
this.add(delete);
this.add(deleteAll);
this.setResizable(false);
this.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(e.getSource().equals(insert)) {
if(text1.getText() != null)
dlm.addElement(text1.getText());
text2.setText(text2.getText() + "\n" + "你插入一个元素到列表");
}
if (e.getSource().equals(delete)){
if(r1.isSelected()){
int index = wordList.getSelectedIndex();
dlm.remove(index);
} else {
int []index = wordList.getSelectedIndices();
for(int i = 0; i < index.length; i++){
dlm.remove(index[i]);
}
}
text2.setText(text2.getText() + "\n" + "你删除列表中的元素");
}
if(e.getSource().equals(deleteAll)){
dlm.removeAllElements();
text2.setText(text2.getText() + "\n" + "你删除列表中的所有元素");
}
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
if(e.getSource().equals(wordList)){
text1.setText("");
if(r1.isSelected())
text1.setText(wordList.getSelectedValue().toString());
else{
int []index = wordList.getSelectedIndices();
for(int i = 0; i < index.length; i++){
text1.setText(text1.getText() + "\r\n" + wordList.getSelectedValue());
}
}
text2.setText(text2.getText() + "\n" + "点击列表");
}
if(e.getSource().equals(r1)){
wordList.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION);
text2.setText(text2.getText() + "\n" + "更改模式为单选");
}
if(e.getSource().equals(r2)){
wordList.setSelectionMode(DefaultListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
text2.setText(text2.getText() + "\n" + "更改模式为多选");
}
}
@Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub

}
@Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub

}
@Override
public void mousePressed(MouseEvent arg0) {
// TODO Auto-generated method stub

}
@Override
public void mouseReleased(MouseEvent arg0) {
// TODO Auto-generated method stub

}
}
这个分拿的不容易啊,费了我好几个小时....
温馨提示:内容为网友见解,仅供参考
第1个回答  2009-06-25
这个问题你不能全交给我们做 你不懂的可以问的
第2个回答  2009-06-25
我也不好给你现在发程序过去
你最好是把你搭起的框架 遇见了什么问题告诉我
我好帮你改造
第3个回答  2009-06-26
第一个 用牛顿迭代法 或者二分法 (具体要看一下计算方法! 我也忘了!)
其他两个 不难
相似回答