在设计新系统时,为了确定系统应该具备何种功能,需要根据实际情况进行分析。在此分析过程中要周全考虑到对象的需求。
系统角色分析
通过对项目整体流程进行梳理,分析得到该项目的实现需要有两种角色,为学生和老师。学生登录之后,可以输入学号查看自己的指导老师、论文设计题目、选题类型、选题类别和选题来源;老师登陆之后,可以查询、添加、修改、删除学生的毕业论文信息,并能按学号进行排序。
系统功能设计
毕业论文管理系统具有多种功能,各种功能之间又有多种联系,构成了一个有机结合的整体。信息处理功能主要涉及数据的采集、输入、加工处理、传输、存储和输出等功能。根据对论文管理系统的分析,系统的主要功能包括:论文信息的添加、显示、删除、修改、查询、排序。毕业论文管理系统的总体功能
package kechengsheji;
import java.io.Serializable;
public class lunwen implements Serializable{
String xh;
String xm;
String jiaoshi;
String lunwentimu;
String leixing;
String leibie;
String laiyuanString;
public String getXh() {
return xh;
}
public void setXh(String xh) {
this.xh = xh;
}
public String getXm() {
return xm;
}
public void setXm(String xm) {
this.xm = xm;
}
public String getJiaoshi() {
return jiaoshi;
}
public void setJiaoshi(String jiaoshi) {
this.jiaoshi = jiaoshi;
}
public String getLunwentimu() {
return lunwentimu;
}
public void setLunwentimu(String lunwentimu) {
this.lunwentimu = lunwentimu;
}
public String getLeixing() {
return leixing;
}
public void setLeixing(String leixing) {
this.leixing = leixing;
}
public String getLeibie() {
return leibie;
}
public void setLeibie(String leibie) {
this.leibie = leibie;
}
public String getLaiyuanString() {
return laiyuanString;
}
public void setLaiyuanString(String laiyuanString) {
this.laiyuanString = laiyuanString;
}
public lunwen(String xh, String xm, String jiaoshi, String lunwentimu, String leixing, String leibie,
String laiyuanString) {
super();
this.xh = xh;
this.xm = xm;
this.jiaoshi = jiaoshi;
this.lunwentimu = lunwentimu;
this.leixing = leixing;
this.leibie = leibie;
this.laiyuanString = laiyuanString;
}
public lunwen() {}
public String toString() {
return this.xh+","+this.xm+","+this.jiaoshi+","+this.lunwentimu+","+this.leixing+","+this.leibie+","+this.laiyuanString;
}
}
package kechengsheji;
import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
public class caidan {
public void ddd() {
ArrayList<lunwen> lw=new ArrayList<lunwen>();
Method method=new Method();//建立方法对象
Scanner sc=new Scanner(System.in);
lunwen []array=new lunwen[5];
array[0]=new lunwen("200801001002","郇政永","安定","现代通信网络中的信息安全","科研课题","应用研究","教师命题");
array[1]=new lunwen("200801001003","姜秀芹","安定","基于asp.net 的都市网络新闻中心","实际问题","应用研究","学生自选");
array[2]=new lunwen("200801001006","宋磊","安定","基于php的网吧贴吧系统","实际问题","应用研究","学生自选");
array[3]=new lunwen("200801001005","赵国庆","王宏","音乐点播网站系统","实际问题","应用研究","学生自选");
array[4]=new lunwen("200801001001","宫大力","王宏","用php实现的列车车次查询系统","模拟问题","应用研究","学生自选");
for(int i=0;i<array.length;i++)
lw.add(array[i]);
int bz=Method.login();
if(bz==1) {
while(true) {//输出菜单
System.out.println("**************************");
System.out.println("*欢迎使用毕业论文管理系统*");
System.out.println("* 1.增加论文信息 *");
System.out.println("* 2.显示论文信息 *");
System.out.println("* 3.查询论文信息 *");
System.out.println("* 4.修改论文信息 *");
System.out.println("* 5.删除论文信息 *");
System.out.println("* 6.论文按学号排序 *");
System.out.println("* 7.退出论文系统 *");
System.out.println("**************************");
System.out.print(" 请输入菜单项(1~7):");
int choice=sc.nextInt();
switch(choice) {
case 1:Method.Add(lw); break;
case 2:Method.display(lw); break;
case 3:Method.seek(lw); break;
case 4:Method.gai(lw); break;
case 5:Method.shan(lw); break;
case 6:method.paixu(array); break;
case 7:System.exit(0);
}
}
}
else {System.out.println("退出系统");
System.exit(0);
}
}
}
package kechengsheji;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Method {
static int login()
{
String username="admin";
String password="my123";
String un,pwd;
int count;
Scanner sc=new Scanner(System.in);
for(count=1;count<=3;count++)
{
System.out.println("请输入用户名:");
un=sc.next();
System.out.println("请输入密码:");
pwd=sc.next();
if(username.equals(un)&&password.equals(pwd))
return 1;
else
if(count<3)
System.out.println("*******用户名或密码输入错误,请重新输入!!!*******");
}
System.out.println("********用户名和密码错误已经超过3次,系统自动退出!!!*******");
return 0;
}
static void showtitle()//显示表头
{
System.out.println("学号"+",姓名"+",指导教师"+", 论文题目"+",选题类型"+",选题类别"+",选题来源");
}
static void Add(ArrayList<lunwen> lw) {//①增加记录
int count=lw.size();
String cpmz;
Scanner sc=new Scanner(System.in);
System.out.println("增加开始");
while(true)
{
lunwen ai=new lunwen();
System.out.println("请输入学号(结束输入请输入00):");
cpmz=sc.next();
if(cpmz.equals("00"))
break;
ai.xh=cpmz;
System.out.println("请输入学生姓名:");
ai.xm=sc.next();
System.out.println("请输入指导教师姓名:");
ai.jiaoshi=sc.next();
System.out.println("请输入论文设计题目:");
ai.lunwentimu=sc.next();
System.out.println("请输入选题类型:");
ai.leixing=sc.next();
System.out.println("请输入选题类别:");
ai.leibie=sc.next();
System.out.println("请输入选题来源:");
ai.laiyuanString=sc.next();
System.out.println("论文信息添加完毕,请按任意键继续");
lw.add(count++,ai);
}
}
static void display(ArrayList<lunwen> lw) //②显示记录
{
showtitle();
for(lunwen e:lw) {
System.out.println(e);
}
}
static void seek (ArrayList<lunwen> lw)//③查询记录
{
String cpmz;
int wz=-1;
System.out.println("请输入要查找的学号");
Scanner sc=new Scanner(System.in);
cpmz=sc.next();
for(int i=0;i<lw.size();i++)
{
if(cpmz.equals(lw.get(i).xh))
{
wz=i;
break;
}
}
if(wz<lw.size()&&wz!=-1)
{
System.out.println("显示查找记录");
showtitle();
System.out.println(lw.get(wz));
}
else
{
System.out.println("查无此人!!!!");
}
}
static void gai (ArrayList<lunwen> lw)//④修改记录
{
String x;
Boolean bz=false;
int wz=0;
String cz;
System.out.println("请输入要修改的学号:");
Scanner sc=new Scanner(System.in);
x=sc.next();
for(int i=0;i<lw.size();i++)
{
if(x.equals(lw.get(i).xh ))
{
bz=true;
wz=i;
break;
}
}
if(bz==true)
{
System.out.println("显示查找记录");
showtitle();
System.out.println(lw.get(wz));
System.out.println("确定要修改吗?(y/n)");
cz=sc.next();
cz=cz.toUpperCase();
if(cz.equals("Y"))
{
System.out.println("请输入学号:");
lw.get(wz).xh=sc.next();
System.out.println("请输入学生姓名:");
lw.get(wz).xm=sc.next();
System.out.println("请输入指导教师:");
lw.get(wz).jiaoshi=sc.next();
System.out.println("请输入论文题目:");
lw.get(wz).lunwentimu=sc.next();
System.out.println("请输入选题类型:");
lw.get(wz).leixing=sc.next();
System.out.println("请输入选题类别:");
lw.get(wz).leibie=sc.next();
System.out.println("请输入选题来源:");
lw.get(wz).laiyuanString=sc.next();
System.out.println("修改成功!");
}
else
System.out.println("修改取消!");
}
else
System.out.println("查无此人!!!!");
}
static void shan (ArrayList<lunwen> lw)//⑤删除记录
{
String cpmz;
String cz;
int wz=-1;
System.out.println("请输入要删除的学生学号");
Scanner sc=new Scanner(System.in);
cpmz=sc.next();
for(int i=0;i<lw.size();i++)
{
if(cpmz.equals(lw.get(i).xh))
{
wz=i;
break;
}
}
if(wz<lw.size()&&wz!=-1)
{
System.out.println("显示要删除的记录");
showtitle();
System.out.println(lw.get(wz));
System.out.println("确定要删除吗?(y/n)");
cz=sc.next();
cz=cz.toUpperCase();
if(cz.equals("Y"))
{
lw.remove(wz);
System.out.println("删除成功");
}
else
{
System.out.println("放弃删除");
}
}
else
{
System.out.println(" 查无此人");
}
}
void paixu(lunwen array[]) //⑥按学号排序
{
lunwen l=new lunwen();
for(int i=0;i<array.length-1;i++)
for(int j=i+1;j<array.length;j++)
if(array[i].xh.compareTo(array[j].xh)>0)
{l=array[i];array[i]=array[j];array[j]=l;}
showtitle();
for(lunwen e:array)
System.out.println(e);
System.out.println("排序成功");
}
}
package kechengsheji;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class window extends JFrame {
private JPanel contentPane;
private JTextField textField_CardID;
private JPasswordField passwordField_pass;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
window frame = new window();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public window() {
setTitle("毕业论文管理系统");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("欢迎进入毕业论文管理系统");
lblNewLabel.setFont(new Font("宋体", Font.PLAIN, 18));
lblNewLabel.setForeground(Color.RED);
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setBounds(10, 10, 416, 39);
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("\u7528\u6237\u540D\uFF1A");
lblNewLabel_1.setFont(new Font("宋体", Font.PLAIN, 14));
lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_1.setBounds(10, 59, 84, 31);
contentPane.add(lblNewLabel_1);
JLabel lblNewLabel_2 = new JLabel("\u5BC6\u7801\uFF1A");
lblNewLabel_2.setFont(new Font("宋体", Font.PLAIN, 14));
lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_2.setBounds(10, 123, 84, 31);
contentPane.add(lblNewLabel_2);
textField_CardID = new JTextField();
textField_CardID.setBounds(104, 64, 322, 21);
contentPane.add(textField_CardID);
textField_CardID.setColumns(10);
passwordField_pass = new JPasswordField();
passwordField_pass.setBounds(104, 128, 322, 21);
contentPane.add(passwordField_pass);
JButton btnOK = new JButton("\u786E\u5B9A");
btnOK.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String ID = "admin";
String Password = "my123";
String a,b;
a=textField_CardID.getText();
b=new String(passwordField_pass.getPassword());
if(ID.equals(a)&&Password.equals(b))
{dispose();
new Mainf().setVisible(true);
}
else JOptionPane.showMessageDialog(null," 用户名或密码错误,请重新输入 ");
}
}
);
btnOK.setBounds(10, 199, 97, 23);
contentPane.add(btnOK);
JButton btnClear = new JButton("\u6E05\u7A7A");
btnClear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
textField_CardID.setText("");
passwordField_pass.setText("");
}
});
btnClear.setBounds(329, 199, 97, 23);
contentPane.add(btnClear);
}
public void Mainf() {
setTitle("\u4E3B\u754C\u9762");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu menu = new JMenu("\u7528\u6237\u540D");
menuBar.add(menu);
JMenuItem menuItem = new JMenuItem("\u6211\u7684\u83DC\u5355");
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
menu.add(menuItem);
JMenu mnNewMenu = new JMenu("\u7535\u5668\u7BA1\u7406");
menuBar.add(mnNewMenu);
JMenuItem menuItem_1 = new JMenuItem("\u7535\u5668\u67E5\u8BE2");
mnNewMenu.add(menuItem_1);
JMenuItem mntmNewMenuItem = new JMenuItem("");
menuBar.add(mntmNewMenuItem);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
contentPane = new JPanel();
contentPane.add(contentPane, BorderLayout.CENTER);
}
}
package kechengsheji;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import java.awt.event.ActionListener;
import java.util.Vector;
import java.awt.event.ActionEvent;
import javax.swing.JButton;
public class Mainf extends JFrame {
private JPanel contentPane;
private JPanel table;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Mainf frame = new Mainf();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Mainf() {
setTitle("\u4E3B\u754C\u9762");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu menu = new JMenu("\u7528\u6237\u540D");
menuBar.add(menu);
JMenuItem menuItem = new JMenuItem("\u6211\u7684\u83DC\u5355");
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
caidan r=new caidan ();
r.ddd();
}
});
menu.add(menuItem);
JMenuItem mntmNewMenuItem = new JMenuItem("");
menuBar.add(mntmNewMenuItem);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
table = new JPanel();
contentPane.add(table, BorderLayout.CENTER);
}
}
本文档描述了一个毕业论文管理系统的实现,系统主要服务于学生和教师。学生可查看个人论文信息,教师则能进行添加、修改、删除和查询操作。系统采用数据处理功能,包括输入、加工、存储和输出等,确保信息的有效管理。通过角色分析和功能设计,展示了系统的具体操作流程和数据结构。
606

被折叠的 条评论
为什么被折叠?



