100分,请教各位高人一道编程题,帮帮忙吧

lingling1981 2004-04-14 09:48:14
小女试着编了,但是错误百出。请各位大哥有空时,帮忙把代码写出来发到我的信箱里可以吗?或者贴在这里。我很想学习学习。谢谢啦!!!tqdao@163.com


题目:编写一个Java小应用程序,模拟小学生入学注册,登记信息包括姓名,性别和出生日期。要求可注册任意多个小学生;然后将小学生的信息按出生日期从大到小的顺序显示出来。
...全文
26 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
MazyTes 2004-04-15
  • 打赏
  • 举报
回复
1981年的,该毕业了吧,是不是毕设,我也在毕设,烦死了!你是哪个学校的?
nm_2j 2004-04-15
  • 打赏
  • 举报
回复
无聊!!!
程序员的悲哀!!!!!
thumb3344 2004-04-15
  • 打赏
  • 举报
回复
up
filippo1980 2004-04-15
  • 打赏
  • 举报
回复
没空写,帮你up
dlxu 2004-04-15
  • 打赏
  • 举报
回复
呵呵,看来可能是交到学校的作业,发到你信箱了,3Q
lostyq 2004-04-14
  • 打赏
  • 举报
回复
晕,莫非你只是想练一下手?
lingling1981 2004-04-14
  • 打赏
  • 举报
回复
1.谢谢CoolAbu(阿卜-Never Stop(★★★★)) !!!

2.回复楼上,

怎么样都行,没有具体要求,只要能完成功能就行。怎样做简单,就怎样做
weihy 2004-04-14
  • 打赏
  • 举报
回复
看来是初学者。
题目要求较简单,只要了解一些基本知识就可做到了。
但谁会有空帮你从头完成呢?还是自己动手把。
你这个是否要保存到文件或数据库?
CoolAbu 2004-04-14
  • 打赏
  • 举报
回复
下面是一个把学生成绩添加到一个文件中,再把文件中成绩显示的例子,但没有用到数据库。
出生日期从大到小的用一个排序就可以了,你参考一下,自己动手会有很多好处的。自己编的如果有问题就贴到这里来,估计没有人专门给你写代码的。


import java.io.*;
import java.util.*;

public class TestScore {
public TestScore() {
LinkedList list=initialize();
writeScore("C:\\score.ser",list);
LinkedList list2= restoreScore("C:\\score.ser");
displayScore(list2);
}

public LinkedList initialize(){
LinkedList link=new LinkedList();
StudentScore s1=new StudentScore("Chinese","abu",90);
link.add(s1);
s1=new StudentScore("Math","abu",91);
link.add(s1);
s1=new StudentScore("English","abu",92);
link.add(s1);
s1=new StudentScore("Chemical","abu",93);
link.add(s1);

return link;
}

public void writeScore(String fileName, LinkedList list)
{
try
{
FileOutputStream fout = new FileOutputStream(fileName);
ObjectOutputStream oout=new ObjectOutputStream(fout);
oout.writeObject(list);
fout.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
public LinkedList restoreScore(String fileName)
{
LinkedList link=null;
try
{
FileInputStream fin=new FileInputStream(fileName);
ObjectInputStream oin=new ObjectInputStream(fin);
Object obj=oin.readObject();
link=(LinkedList)obj;
}
catch(Exception e)
{
e.printStackTrace();
}
return link;
}

public void displayScore(LinkedList list)
{
Iterator iter=list.iterator();
while(iter.hasNext())
{
StudentScore ss=(StudentScore)iter.next();
System.out.println(ss.getStudentID()+"'s "+ ss.getCourseName()+" Score is:"+ss.getScore());
}

}


public static void main(String[] args) {
TestScore testScore1 = new TestScore();
}

}

class StudentScore implements Serializable
{
private String courseName, studentID;
private int score;

public StudentScore(String courseName, String studentID,int score)
{
this.courseName=courseName;
this.studentID=studentID;
this.score=score;
}

public String getCourseName()
{
return this.courseName;
}
public String getStudentID()
{
return this.studentID;
}
public int getScore()
{
return this.score;
}
}
Arias 2004-04-14
  • 打赏
  • 举报
回复
你的要求不是很明确,你的显示是如何,以及你的注册信息又怎样处理!
应该不是很难的!
lingling1981 2004-04-14
  • 打赏
  • 举报
回复

up

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧