学生成绩管理系统课程设计报告33010_第1页
学生成绩管理系统课程设计报告33010_第2页
学生成绩管理系统课程设计报告33010_第3页
已阅读5页,还剩33页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、软件工程综合实验学生姓名袁春艳学号1018014081班级计本103班成绩指导教师曹阳数学与计算机科学学院2012年12月3日目录第一章 绪 论 11.1 设计目的 11.2 开发工具选择 11.3 开发环境 1第二章 需求分析 22.1 系统需求简介 22.1.1 问题定义 22.1.2 功能需求分析 22.1.3 性能需求分析 22.1.4 用户需求 2第三章 总体设计 53.1 设计概述 53.2 系统数据库概念结构设计 53.2.1 系统 E-R 图 53.2.2 系统数据设计 63.3 安全保密设计 6第四章 实现 84.1 程序代码 84.2 程序运行结果 31第五章 课程设计心得

2、 34学生成绩管理系统第一章 绪论1.1设计目的通过本实验掌握软件工程 SA或00A需求分析方法和技术。要求做到使用结构化数据 流分析技术或面向对象分析技术分析教学管理系统需求,写出详细的数据流图和数据字典。1.2开发工具选择开发工具:计算机、“ C+编程环境”或者“ JAVA编程环境”、SQL Server 2000、文档 编辑器(MS、WORD )、画图工具(viso)。1.3开发环境学生成绩管理系统运行环境要求: 操作系统: wi ndows 2000/XP/w in dows 7 数据库管理系统:SQL server 2000 硬件需求:内存 256M以上第二章需求分析2.1系统需求简

3、介问题定义本系统需进行学生成绩管理,主要用户有:管理员、学生、教师。各用户具体需操作的 功能如下: 管理员,登陆,进入系统,可进行管理员操作,进行查询、删除、修改、添加、打 印等操作。 学生,登陆,进入系统,可进行查询、修改、打印等操作。 教师,登陆,进入系统,可进行查询、学生成绩录入、修改、打印等操作。功能需求分析本系统的功能需求分析如下: 学生信息查询:学生可以根据学号、姓名、专业进行查询 学生信息管理:主要是用于学生信息更新、插入、删除; 学生成绩录入:用于学生成绩管理,录入学生成绩,也可以更新;性能需求分析 登录、用户界面需求:简洁、易懂、易用、友好的用户界面。 安全保密性需求:只有凭

4、借用户名和密码登陆系统,才能进行信息的管理等。用户需求删除, 本系统具有很强的可靠性、可对录入的学生信息进行校验,对数据进行修改、规定各种权限。 本系统中的模块要求很强的可持续性,可以方便管理人员的修改与维护。 本系统操作方便、灵活、高效。 本系统课高效、快速的查询学生的基本信息。查询条件返回信息学生查询结果学生成绩- 管理系统*.学生信息、课程信息、 教师信息管理员学生条件1.查询杳询)返回信息返 回 信 息成 绩 信 息教师顶层数据流图学生信息管理员课程信息、教师 信息成绩信息教师返回信息课程信息成绩信息表学生信息2.学生管 理3.课程管 理4.成绩管 理学生成绩信息图2零层数据流图图3

5、一层数据流图返回信息返 回 信 息图4二层数据流图学生成绩信息第三章总体设计3.1设计概述每个模块完成一个特定的子功能。把这些模块根据需求把整个系统分化成不同的模块, 结合起来组成一个整体。逐一实现各个功能。3.2系统数据库概念结构设计根据对数据项与数据结构的分析,设计出能够满足系统需求的各种实体,及它们之间的关系,为后面的逻辑结构设计打下基础。系统E-R图322系统数据设计department_tabl冒 numbern ameinclass table曾 numbefnamedEpatmenta -<“:-(*)Fcourse indassscore table$ stjjdent_

6、numbe 冒 coursenumber score tead"ier_number tErm匕QCaccount table? iduserNamepassi ordpermissioncon rsetableg numbername图6数据库关系图3.3安全保密设计系统设计了登录界面, 每个合法用户有用户名及一个密码,只有当用户输入正确的用户 名及密码组合后才能够对学生信息进行操作。登陆退出图7登陆界面1 -1|(ij 燮陆咸功V图8登陆成功界面第四章实现4.1程序代码package api;import java.util.List; mport doma in. Acco u

7、nt;import doma in. Stude nt; import doma in. Teacher;public in terface IAcco un tDaoAcco unt fin dAcco un t(Stri ng userName, String password); boolea n isUserd(Stri ng userName);Stude nt fin dStude nt(Acco unt acco un t);Teacher fin dTeacher(Acco unt acco un t);Acco unt fin dAcco un t(Stude nt stud

8、e nt);Acco unt fin dAcco un t(Teacher teacher);void deleteAcco un t(Stude nt stude nt,Acco unt acco un t); void deleteAcco un t(Teacher teacher,Acco unt acco un t); void addAcco un t(Stude nt stude nt,Acco unt acco un t); void addAcco un t(Teacher teacher,Acco unt acco un t); void updateAcco un t(St

9、ude nt stude nt,Acco unt acco un t); void updateAcco un t(Teacher teacher,Acco unt acco un t); package api;import java.util.List;import doma in. Acco unt;import doma in. Stude nt; import doma in. Teacher;public in terface IAcco un tServiceAcco unt logi n( Stri ng userName, String password);Stude nt

10、fin dStude nt(Acco unt acco un t); Teacher fin dTeacher(Acco unt acco un t); Acco unt fin dAcco un t(Stude nt stude nt); Acco unt fin dAcco un t(Teacher teacher);void removeAcco un t(Stude nt stude nt,Acco unt acco un t); void removeAcco un t(Teacher teacher,Acco unt acco un t); void addAcco un t(St

11、ude nt stude nt,Acco unt acco un t); void addAcco un t(Teacher teacher,Acco unt acco un t); void updateAcco un t(Stude nt stude nt,Acco unt acco un t); void updateAcco un t(Teacher teacher,Acco unt acco un t);package sgm.ui;import javax.swi ng.JOptio nPane;import doma in. Acco unt;import api.lAcco u

12、n tService;import service.Acco un tService;public class Logi nWindow exte nds javax.sw in g.JFrameprivate IAcco un tService acco un tService;public Logi nWin dow(IAcco un tService acco un tService)in itComp onen ts();setLocati on RelativeTo (n ull);this.acco un tService = acco un tService;private vo

13、id in itComp onen ts() private void userNameTextActio nPeformed(java.awt.eve nt.Actio nEve nt evt) private void exitButt onAction Performed(java.awt.eve nt.Act ionEvent evt) System.exit(O);private void log in Butt on Acti on Performed(java.awt.eve nt.Act ion Eve nt evt) Stri ng userName = userNameTe

14、xt.getText().trim();String password = Strin g.valueOf(passwordText.getPassword();if ("".equals(userName) JOptionPane.showMessageDialog(this,"输入的用户名不能为空!");return;if ("".equals(password) JOptionPane.showMessageDialog(this,"输入的密码不能为空!");return;try Acco unt acco

15、unt = acco un tServiceogin( userName, password);JOptionPane.showMessageDialog(this,"登陆成功! ”); this.setVisible(false);new MainWindow(account).setVisible(true); catch (Excepti on e) JOptio nPan e.showMessageDialog(this, e.getMessage();private javax.swing.JButton exitButton;private javax.swi ng.JL

16、abel jLabel1;private javax.sw in g.JLabel jLabel2;private javax.swing.JButton loginButton;private javax.swing.JPasswordField passwordText;private javax.swi ng.JTextField userNameText;package sgm.ui;import java.awt.Color;import java.awt.eve nt.Act ion Eve nt;import javax.swi ng.*;import domai n.*;imp

17、ort factory.Factory;import api.IAcco un tService;import sgm.ma nager.ui.*;import sgm.stude nt.ui.Stude ntl nfoDialog;import sgm.stude nt.ui.Stude ntQueryScoreDialog;import sgm.teacher.ui.TeacherI nfoDailog;import sgm.teacher.ui.TeacherI nputScoreDialog;public class Mai nWin dow exte nds javax.swi ng

18、.JFrame private Acco unt acco unt;private Action allStudentsInfoAction;private Acti on allTeachers In foAct ion;private Action allAccountsAction;private Acti on allScoreAct ion;private Acti on allCourseActi on;private Acti on choiceCourseActi on;private Acti on stude nln foAct ion;private Acti on st

19、ude ntQueryScoreAct ion;private Acti on teacherI nfoAct ion;private Acti on teacherI nputAct ion; private Acti on exitAct ion;public Mai nWin dow(Acco unt acco unt)this.setSize(800, 600);setTitle(”学生成绩管理系统首页”); setDefaultCloseOperati on (EXIT_ON_CLOSE); setLocati on RelativeTo (n ull);this.acco unt

20、= acco unt;JLabel label = new JLabel( new ImageIc on ("image/s un set.jpg"); this.add(label);createAct ion s(); setPermissi on();private void setPermissi on()int permissi on = accou nt.getPermissio n();if (permissi on = 1) JMe nuBar bar = new JMe nuBar();JMenu menu1 = new JMenu(” 基本信息管理”);

21、men u1.add(stude ntQueryScoreActi on);bar.add(me nul);this.setJMe nuBar(bar);if (permissi on = 2) JMe nuBar bar = new JMe nuBar();JMenu menu1 = new JMenu(” 基本信息管理”);men u1.add(teacherl nfoAct ion);men u1.add(teacherl nputActi on);bar.add(me nu1);this.setJMe nuBar(bar);if (permissi on = 3) JMe nuBar

22、bar = new JMe nuBar();JMenu menu1 = new JMenu(” 基本信息管理”);men u1.add(allStude ntsln foActi on);men u1.add(allTeachersl nfoActio n);men u1.add(allCourseActio n);men u1.add(allAcco un tsActio n);bar.add(me nu1);JMenu menu2 = new JMenu(” 选课管理”);menu 2.add(choiceCourseAct ion);bar.add(me nu 2);JMenu menu

23、3 = new JMenu("系统管理");men u3.add(exitActi on);bar.add(me nu 3);this.setJMe nuBar(bar);private void createActi on s() exitAction =new AbstractAction(” 安全退出")Overridepublic void action Performed(Acti onEvent e) System.exit(0);allStudentslnfoAction = new AbstractAction(” 学生信息管理")Ove

24、rridepublic void action Performed(Acti onEvent e) AllStuden ts In foDialog dialog = new AllStude ntsl nfoDialog(Mai nWin dow.this);dialog.setVisible(true);allTeachersInfoAction = new AbstractAction(” 教师信息管理") Overridepublic void action Performed(Acti onEvent e) AllTeachers In foDialog dialog =

25、new AllTeachers In foDialog(Mai nWin dow.this);dialog.setVisible(true);allCourseAction = new AbstractAction(” 课程信息管理")Overridepublic void action Performed(Acti onEvent e) AllCourses In foDialog dialog = new AllCoursesI nfoDialog(Mai nWin dow.this);dialog.setVisible(true);allAccountsAction = new

26、 AbstractAction(” 账户管理")Overridepublic void action Performed(Acti onEvent e) Acco un tI nfoDialog dialog = new Acco untln foDialog(Mai nWin dow.this);dialog.setVisible(true);allScoreAction = new AbstractAction(” 成绩管理")Overridepublic void action Performed(Acti onEvent e) JOptio nPan e.showM

27、essageDialog(Mai nWin dow.this,"成绩管理功能还没实 现! ”);;choiceCourseAction = new AbstractAction(” 选课管理")Overridepublic void action Performed(Acti onEvent e) ChoiceCourseDialog dialog = new ChoiceCourseDialog(Mai nWin dow.this);dialog.setVisible(true);stude nln foAction = new AbstractActio n(” 基本信

28、息")Overridepublic void action Performed(Acti onEvent e) Stude nt stude nt = Factory.createAcco un tService().fi ndStude nt(acco un t);Stude ntl nfoDialog dialog = new Stude ntln foDialog(Mai nWin dow.this, stude nt);dialog.setVisible(true);studentQueryScoreAction = new AbstractAction(” 查看成绩&quo

29、t;)Overridepublic void action Performed(Acti onEvent e) Stude nt stude nt = Factory.createAcco un tService().fi ndStude nt(acco un t);Stude ntQueryScoreDialog dialog = new Stude ntQueryScoreDialog(Mai nWin dow.this, stude nt);dialog.setVisible(true);teacherInfoAction = new AbstractAction(” 基本信息"

30、;)Overridepublic void action Performed(Acti onEvent e) Teacher teacher = Factory.createAcco un tService().fi ndTeacher(acco un t);TeacherI nfoDailog dialog = new TeacherI nfoDailog(MainWin dow.this, teacher);dialog.setVisible(true);teacherInputAction = new AbstractAction(” 录入成绩 ")Overridepublic

31、 void action Performed(Acti onEvent e) Teacher teacher = Factory.createAcco un tService().fi ndTeacher(acco un t);if(Factory.createChoiceCourseService().fi ndIn class(teacher).isEmpty()JOptio nPa ne.showMessageDialog(Mai nWin dow.this,"录入成绩功能未 开通!");return;TeacherI nputScoreDialog dialog =

32、 new TeacherI nputScoreDialog(MainWin dow.this, teacher);dialog.setVisible(true);package doma in;public class Acco unt private int id;private String userName;private String password;private int permissi on;public Account(int id, String name, String password, int permission) this.id = id;this.userNam

33、e = n ame;this.password = password;this.permissi on = permissi on;public in t getId() return id;public void setld(i nt id) this.id = id;public String getName() return userName;public void setName(Stri ng n ame) this.userName = n ame;public String getPassword() retur n password;public void setPasswor

34、d(Stri ng password) this.password = password;public int getPermissi on() retur n permissi on;public void setPermissi on (i nt permissi on) this.permissi on = permissi on;Override public int hashCode() final int prime = 31; int result = 1;result = prime * result + id; return result;Overridepublic boo

35、lea n equals(Object obj) if (this = obj) return true;if (obj = nu II) return false;if (getClass() != obj.getClass() return false;Acco unt other = (Acco unt) obj; if (id != other.id)return false;return true;package doma in;public class Course private int nu mber; private String name;public Course(int

36、 number, String name) super();this .nu mber = nu mber; this. name = n ame;public int getNumber() retur n nu mber;public void setNumber(i nt nu mber) this .nu mber = nu mber;public String getName() return n ame;public void setName(Stri ng n ame) this. name = n ame;Overridepublic int hashCode() final

37、int prime = 31;int result = 1;result = prime * result + nu mber; return result;Overridepublic boolea n equals(Object obj) if (this = obj) return true;if (obj = nu II)return false;if (getClass() != obj.getClass()return false;Course other = (Course) obj;if (nu mber != other. nu mber) return false;retu

38、rn true;Overridepublic Stri ng toStri ng()return n ame;package doma in;public class Score private String stude nt_nu mber;private int course_number;private int score;private String teacher_ nu mber;private String term;public Score(Stri ng stude nt_nu mber, i nt course_ nu mber, i nt score, String te

39、acher_ nu mber, String term) this.stude nt_nu mber = stude nt_nu mber;this.course_ nu mber = course_ nu mber;this.score = score;this.teacher_ nu mber = teacher_ nu mber; this.term = term;public String getStude nt_nu mber() retur n stude nt_nu mber;public void setStude nt_nu mber(Stri ng stude nt_nu

40、mber) this.stude nt_nu mber = stude nt_nu mber;public int getCourse_ nu mber() retur n course_ nu mber;public void setCourse_ nu mber(i nt course_ nu mber) this.course_ nu mber = course_ nu mber;public int getScore() retur n score;public void setScore(i nt score) this.score = score;public String get

41、Teacher_ nu mber() retur n teacher_ nu mber;public void setTeacher_ nu mber(Stri ng teacher_ nu mber) this.teacher_ nu mber = teacher_ nu mber;public String getTerm() return term;public void setTerm(Stri ng term) this.term = term;Overridepublic int hashCode() final int prime = 31;int result = 1;resu

42、lt = prime * result + course_ nu mber;result = prime * result+ (stude nt_nu mber = n ull) ? 0 : stude nt_nu mber.hashCode(); return result;Overridepublic boolea n equals(Object obj) if (this = obj)return true;if (obj = nu II)return false;if (getClass() != obj.getClass()return false;Score other = (Sc

43、ore) obj;if (course_ nu mber != other.course_ nu mber)return false;if (stude nt_nu mber = n ull) if (other.stude nt_nu mber != n ull) return false; else if (!stude nt_nu mber.equals(other.stude nt_nu mber)return false;return true;package doma in;public class Stude nt private String number;private St

44、ring name;private String sex;private int age;private Departme nt departme nt;private String pho neNumber;private Stri ng IdCardNo;private In class in class;private String homeAddress;public Student(String number, String name, String sex, int age,Departme nt departme nt. String pho neNumber, String i

45、dCardNo, In class in class, String homeAddress) this .nu mber = nu mber;this. name = n ame;this.sex = sex;this.age = age; this.departme nt = departme nt;this.ph on eNumber = pho neNumber;IdCardNo = idCardNo;this.i nclass = in class; this.homeAddress = homeAddress;public String getNumber() retur n nu

46、 mber;public void setNumber(Stri ng nu mber) this .nu mber = nu mber;public String getName() return n ame;public void setName(Stri ng n ame) this. name = n ame;public Stri ng getSex() return sex;public void setSex(Stri ng sex) this.sex = sex;public int getAge() return age;public void setAge(i nt age

47、) this.age = age;public Departme nt getDepartme nt() retur n departme nt;public void setDepartme nt(Departme nt departme nt) this.departme nt = departme nt;public String getPh on eNumber() retur n phon eNumber;public void setPh on eNumber(Stri ng pho neNumber) this.ph on eNumber = pho neNumber;publi

48、c String getldCardNo() return IdCardNo;public void setldCardNo(Stri ng idCardNo) IdCardNo = idCardNo;public In class get In class() retur n in class;public void set In class(I nclass in class) this.i nclass = in class;public String getHomeAddress() retur n homeAddress;public void setHomeAddress(Stri

49、 ng homeAddress) this.homeAddress = homeAddress; package factory;import java.util.List; import dao.Acco un tDao;import dao.ChoiceCourseDao;import dao.CourseDao;import dao.Departme ntDao;import dao.ln classDao;import dao.ScoreDao;import dao.Stude ntDao;import dao.TeacherDao;import doma in .Departme n

50、t;import doma in.ln class;import api.IAcco un tDao;import api.IAcco un tService;import api.IChoiceCourseDao;import api.IChoiceCourseService;import api.ICourseDao;import api.ICourseService;import api.IDeparme ntDao;import api.IDepartme ntService;import api.II nclassDao;import api.II nclassService;imp

51、ort api.IScoreDao;import api.IScoreService;import api.IStude ntDao;import api.IStude ntService;import api.ITeacherDao;import api.ITeacherService;import service.Acco un tService;import service.ChoiceCourseService; import service.CourseService;import service.Departme ntService; import service .In clas

52、sService;import service.ScoreService;import service.Stude ntService; import service.TeacherService; public class Factory private static IAcco un tDao acco un tDao = new Acco un tDao();private static IStude ntDao stude ntDao = new Stude ntDao();private static IStude ntService stude ntService = new St

53、ude ntService( stude ntDao);private static IDeparme ntDao deparme ntDao = new Departme ntDao();private static IAcco un tService acco un tService = new Acco un tService( acco un tDao);private static IDepartme ntService departme ntService = new Departme ntService( deparme ntDao);private static Ilnclas

54、sDao inclassDao = new InclassDao();private static Iln classService in classService = new In classService(in classDao);private static ITeacherDao teacherDao = new TeacherDao();private static ITeacherService teacherService = new TeacherService( teacherDao);private static IScoreDao scoreDao = new ScoreDao();private static IScoreService scoreService =new ScoreService(i nclassService,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论