




已阅读5页,还剩31页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
软件工程综合实验学生姓名 袁春艳学号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第五章 课程设计心得34学生成绩管理系统第一章 绪论1.1 设计目的 通过本实验掌握软件工程SA或OOA需求分析方法和技术。要求做到使用结构化数据流分析技术或面向对象分析技术分析教学管理系统需求,写出详细的数据流图和数据字典。1.2 开发工具选择 开发工具:计算机、“C+编程环境”或者“JAVA编程环境”、SQL Server 2000、文档编辑器(MS、WORD)、画图工具(viso)。1.3 开发环境 学生成绩管理系统运行环境要求: 操作系统:windows 2000/XP/windows 7 数据库管理系统:SQL server 2000 硬件需求:内存256M以上第二章 需求分析2.1系统需求简介2.1.1问题定义 本系统需进行学生成绩管理,主要用户有:管理员、学生、教师。各用户具体需操作的功能如下: 管理员,登陆,进入系统,可进行管理员操作,进行查询、删除、修改、添加、打印等操作。 学生,登陆,进入系统,可进行查询、修改、打印等操作。 教师,登陆,进入系统,可进行查询、学生成绩录入、修改、打印等操作。2.1.2功能需求分析本系统的功能需求分析如下: 学生信息查询:学生可以根据学号、姓名、专业进行查询. 学生信息管理:主要是用于学生信息更新、插入、删除; 学生成绩录入:用于学生成绩管理,录入学生成绩,也可以更新;2.1.3性能需求分析 登录、用户界面需求:简洁、易懂、易用、友好的用户界面。 安全保密性需求:只有凭借用户名和密码登陆系统,才能进行信息的管理等。2.1.4用户需求 本系统具有很强的可靠性、可对录入的学生信息进行校验,对数据进行修改、删除,规定各种权限。 本系统中的模块要求很强的可持续性,可以方便管理人员的修改与维护。 本系统操作方便、灵活、高效。 本系统课高效、快速的查询学生的基本信息。 图1 顶层数据流图 图2 零层数据流图 图3 一层数据流图 图4 二层数据流图第三章 总体设计3.1设计概述根据需求把整个系统分化成不同的模块,每个模块完成一个特定的子功能。把这些模块结合起来组成一个整体。逐一实现各个功能。3.2系统数据库概念结构设计根据对数据项与数据结构的分析,设计出能够满足系统需求的各种实体,及它们之间的关系,为后面的逻辑结构设计打下基础。3.2.1系统E-R图课程表成绩学号课程号号成绩表选课学生表学号姓名生日系名总成绩备注性别学分学生人数开课时间课程名课程号考核系统E-R图可以将各个实体之间的关系显示出来,将各个实体间的属性依赖表示明白。如图5系统E-R图结构。图5系统E-R图结构3.2.2系统数据设计图6数据库关系图3.3安全保密设计系统设计了登录界面,每个合法用户有用户名及一个密码,只有当用户输入正确的用户名及密码组合后才能够对学生信息进行操作。图7 登陆界面图8登陆成功界面第四章 实现4.1程序代码package api;import java.util.List;mport domain.Account;import domain.Student;import domain.Teacher;public interface IAccountDao Account findAccount(String userName, String password);boolean isUserd(String userName);Student findStudent(Account account);Teacher findTeacher(Account account);Account findAccount(Student student);Account findAccount(Teacher teacher);void deleteAccount(Student student,Account account);void deleteAccount(Teacher teacher,Account account);void addAccount(Student student,Account account);void addAccount(Teacher teacher,Account account);void updateAccount(Student student,Account account);void updateAccount(Teacher teacher,Account account);package api;import java.util.List;import domain.Account;import domain.Student;import domain.Teacher;public interface IAccountService Account login(String userName, String password);Student findStudent(Account account);Teacher findTeacher(Account account);Account findAccount(Student student);Account findAccount(Teacher teacher);void removeAccount(Student student,Account account);void removeAccount(Teacher teacher,Account account);void addAccount(Student student,Account account);void addAccount(Teacher teacher,Account account);void updateAccount(Student student,Account account);void updateAccount(Teacher teacher,Account account);package sgm.ui;import javax.swing.JOptionPane;import domain.Account;import api.IAccountService;import service.AccountService;public class LoginWindow extends javax.swing.JFrame private IAccountService accountService; public LoginWindow(IAccountService accountService) initComponents();setLocationRelativeTo(null);this.accountService = accountService; private void initComponents() private void userNameTextActionPerformed(java.awt.event.ActionEvent evt) private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) System.exit(0); private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) String userName = userNameText.getText().trim();String password = String.valueOf(passwordText.getPassword();if (.equals(userName) JOptionPane.showMessageDialog(this, 输入的用户名不能为空!);return;if (.equals(password) JOptionPane.showMessageDialog(this, 输入的密码不能为空!);return;try Account account = accountService.login(userName, password);JOptionPane.showMessageDialog(this, 登陆成功!);this.setVisible(false);new MainWindow(account).setVisible(true); catch (Exception e) JOptionPane.showMessageDialog(this, e.getMessage(); private javax.swing.JButton exitButton;private javax.swing.JLabel jLabel1;private javax.swing.JLabel jLabel2;private javax.swing.JButton loginButton;private javax.swing.JPasswordField passwordText;private javax.swing.JTextField userNameText;package sgm.ui;import java.awt.Color;import java.awt.event.ActionEvent;import javax.swing.*;import domain.*;import factory.Factory;import api.IAccountService;import sgm.manager.ui.*;import sgm.student.ui.StudentInfoDialog;import sgm.student.ui.StudentQueryScoreDialog;import sgm.teacher.ui.TeacherInfoDailog;import sgm.teacher.ui.TeacherInputScoreDialog;public class MainWindow extends javax.swing.JFrame private Account account;private Action allStudentsInfoAction;private Action allTeachersInfoAction;private Action allAccountsAction;private Action allScoreAction;private Action allCourseAction;private Action choiceCourseAction;private Action studenInfoAction;private Action studentQueryScoreAction;private Action teacherInfoAction;private Action teacherInputAction;private Action exitAction;public MainWindow(Account account) this.setSize(800, 600);setTitle(学生成绩管理系统首页);setDefaultCloseOperation(EXIT_ON_CLOSE);setLocationRelativeTo(null);this.account = account;JLabel label = new JLabel(new ImageIcon(image/sunset.jpg);this.add(label);createActions();setPermission();private void setPermission() int permission = account.getPermission();if (permission = 1) JMenuBar bar = new JMenuBar();JMenu menu1 = new JMenu(基本信息管理);menu1.add(studentQueryScoreAction);bar.add(menu1);this.setJMenuBar(bar);if (permission = 2) JMenuBar bar = new JMenuBar();JMenu menu1 = new JMenu(基本信息管理);menu1.add(teacherInfoAction);menu1.add(teacherInputAction);bar.add(menu1);this.setJMenuBar(bar);if (permission = 3) JMenuBar bar = new JMenuBar();JMenu menu1 = new JMenu(基本信息管理);menu1.add(allStudentsInfoAction);menu1.add(allTeachersInfoAction);menu1.add(allCourseAction);menu1.add(allAccountsAction);bar.add(menu1);JMenu menu2 = new JMenu(选课管理);menu2.add(choiceCourseAction);bar.add(menu2);JMenu menu3 = new JMenu(系统管理);menu3.add(exitAction);bar.add(menu3);this.setJMenuBar(bar); private void createActions() exitAction =new AbstractAction(安全退出) Overridepublic void actionPerformed(ActionEvent e) System.exit(0);allStudentsInfoAction = new AbstractAction(学生信息管理) Overridepublic void actionPerformed(ActionEvent e) AllStudentsInfoDialog dialog = new AllStudentsInfoDialog(MainWindow.this);dialog.setVisible(true);allTeachersInfoAction = new AbstractAction(教师信息管理) Overridepublic void actionPerformed(ActionEvent e) AllTeachersInfoDialog dialog = new AllTeachersInfoDialog(MainWindow.this);dialog.setVisible(true);allCourseAction = new AbstractAction(课程信息管理) Overridepublic void actionPerformed(ActionEvent e) AllCoursesInfoDialog dialog = new AllCoursesInfoDialog(MainWindow.this);dialog.setVisible(true);allAccountsAction = new AbstractAction(账户管理) Overridepublic void actionPerformed(ActionEvent e) AccountInfoDialog dialog = new AccountInfoDialog(MainWindow.this);dialog.setVisible(true);allScoreAction = new AbstractAction(成绩管理) Overridepublic void actionPerformed(ActionEvent e) JOptionPane.showMessageDialog(MainWindow.this, 成绩管理功能还没实现!);choiceCourseAction = new AbstractAction(选课管理) Overridepublic void actionPerformed(ActionEvent e) ChoiceCourseDialog dialog = new ChoiceCourseDialog(MainWindow.this);dialog.setVisible(true);studenInfoAction = new AbstractAction(基本信息) Overridepublic void actionPerformed(ActionEvent e) Student student = Factory.createAccountService().findStudent(account);StudentInfoDialog dialog = new StudentInfoDialog(MainWindow.this, student);dialog.setVisible(true); ;studentQueryScoreAction = new AbstractAction(查看成绩) Overridepublic void actionPerformed(ActionEvent e) Student student = Factory.createAccountService().findStudent(account);StudentQueryScoreDialog dialog = new StudentQueryScoreDialog(MainWindow.this, student);dialog.setVisible(true);teacherInfoAction = new AbstractAction(基本信息) Overridepublic void actionPerformed(ActionEvent e) Teacher teacher = Factory.createAccountService().findTeacher(account);TeacherInfoDailog dialog = new TeacherInfoDailog(MainWindow.this, teacher);dialog.setVisible(true);teacherInputAction = new AbstractAction(录入成绩) Overridepublic void actionPerformed(ActionEvent e) Teacher teacher = Factory.createAccountService().findTeacher(account);if(Factory.createChoiceCourseService().findInclass(teacher).isEmpty()JOptionPane.showMessageDialog(MainWindow.this, 录入成绩功能未开通!);return;TeacherInputScoreDialog dialog = new TeacherInputScoreDialog(MainWindow.this, teacher);dialog.setVisible(true); ;package domain;public class Account private int id; private String userName; private String password; private int permission;public Account(int id, String name, String password, int permission) this.id = id;this.userName = name;this.password = password;this.permission = permission;public int getId() return id;public void setId(int id) this.id = id;public String getName() return userName;public void setName(String name) this.userName = name;public String getPassword() return password;public void setPassword(String password) this.password = password;public int getPermission() return permission;public void setPermission(int permission) this.permission = permission;Overridepublic int hashCode() final int prime = 31;int result = 1;result = prime * result + id;return result; Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;Account other = (Account) obj;if (id != other.id)return false;return true;package domain;public class Course private int number;private String name; public Course(int number, String name) super();this.number = number; = name; public int getNumber() return number; public void setNumber(int number) this.number = number; public String getName() return name; public void setName(String name) = name; Overridepublic int hashCode() final int prime = 31;int result = 1;result = prime * result + number;return result; Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;Course other = (Course) obj;if (number != other.number)return false;return true;Overridepublic String toString()return name;package domain;public class Score private String student_number;private int course_number;private int score;private String teacher_number;private String term;public Score(String student_number, int course_number, int score,String teacher_number, String term) this.student_number = student_number;this.course_number = course_number;this.score = score;this.teacher_number = teacher_number;this.term = term;public String getStudent_number() return student_number;public void setStudent_number(String student_number) this.student_number = student_number;public int getCourse_number() return course_number;public void setCourse_number(int course_number) this.course_number = course_number;public int getScore() return score;public void setScore(int score) this.score = score;public String getTeacher_number() return teacher_number;public void setTeacher_number(String teacher_number) this.teacher_number = teacher_number;public String getTerm() return term; public void setTerm(String term) this.term = term; Overridepublic int hashCode() final int prime = 31;int result = 1;result = prime * result + course_number;result = prime * result+ (student_number = null) ? 0 : student_number.hashCode();return result; Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;Score other = (Score) obj;if (course_number != other.course_number)return false;if (student_number = null) if (other.student_number != null)return false; else if (!student_number.equals(other.student_number)return false;return true;package domain;public class Student private String number;private String name;private String sex;private int age;private Department department;private String phoneNumber;private String IdCardNo;private Inclass inclass;private String homeAddress; public Student(String number, String name, String sex, int age,Department department, String phoneNumber, String idCardNo,Inclass inclass, String homeAddress) this.number = number; = name;this.sex = sex;this.age = age;this.department = department;this.phoneNumber = phoneNumber;IdCardNo = idCardNo;this.inclass = inclass;this.homeAddress = homeAddress;public String getNumber() return number; public void setNumber(String number) this.number = number; public String getName() return name; public void setName(String name) = name; public String getSex() return sex; public void setSex(String sex) this.sex = sex; public int getAge() return age; public void setAge(int age) this.age = age; public Department getDepartment() return department; public void setDepartment(Department department) this.department = department; public String getPhoneNumber() return phoneNumber;public void setPhoneNumber(String phoneNumber) this.phoneNumber = phoneNumber; public String getIdCardNo() return IdCardNo; public void setIdCardNo(String idCardNo) IdCardNo = idCardNo; public Inclass getInclass() return inclass; public void setInclass(Inclass inclass) this.inclass = inclass; public String getHomeAddress() return homeAddress; public void setHomeAddress(String homeAddress) this.homeAddress = homeAddress;package factory;import java.util.List;import dao.AccountDao;import dao.ChoiceCourseDao;import dao.CourseDao;import dao.DepartmentDao;import dao.InclassDao;import dao.ScoreDao;import dao.StudentDao;import dao.TeacherDao;import domain.Department;import domain.Inclass;import api.IAccountDao;import api.IAccountService;import api.IChoiceCourseDao;import api.IChoiceCourseService;import api.ICourseDao;import api.ICourseService;import api.IDeparmentDao;import api.IDepartmentService;import api.IInclassDao;import api.IInclassService;import api.IScoreDao;import api.IScoreService;import api.IStudentDao;import api.IStudentService;import api.ITeacherDao;import api.ITeacherService;import service.AccountService;import service.ChoiceCourseService;import service.CourseService;import service.DepartmentService;import service.InclassService;import service.ScoreService;import service.StudentService;import service.TeacherService;public class Factory private static IAccountDao accountDao = new AccountDao();private static IStudentDao studentDao = new StudentDao();private static IStudentService studentService = new StudentService(studentDao);private static IDeparmentDao deparmentDao = new DepartmentDao();private static IAccountService accountService = new AccountService(accountDao);private static IDepartmentService departmentService = new DepartmentService(deparmentDao);private static IInclassDao inclassDao = new InclassDao();private static IInclassService inclassService = new InclassService(inclassDao);private static ITeacherDao teacherDao = new TeacherDao();private static ITeacherService
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 南阳科技职业学院《学前儿童游戏与指导》2023-2024学年第二学期期末试卷
- 常州幼儿师范高等专科学校《货运和商务管理》2023-2024学年第二学期期末试卷
- 烟台大学《影视造型》2023-2024学年第二学期期末试卷
- 内蒙古工业职业学院《人力资源管理经典著作选读》2023-2024学年第二学期期末试卷
- 马鞍山师范高等专科学校《听力四》2023-2024学年第二学期期末试卷
- 江南影视艺术职业学院《中国共产党建设理论与实践》2023-2024学年第二学期期末试卷
- 苏州城市学院《学年创作》2023-2024学年第二学期期末试卷
- 分析化学面试题库及答案
- 储粮安全活动方案
- 儿歌传唱活动方案
- 婚前拆迁婚内协议书
- 常州文化测试试题及答案
- 会考地理综合题答题模板+简答题归纳-2025年会考地理知识点梳理
- 国开《离散数学》形考任务1-3试题及答案
- 预防VTE质控汇报演讲
- T-FJTEA 001-2024 白云石粉改良酸化茶园土壤技术规范
- 第11课《屹立在世界的东方》第3课时 自力更生 扬眉吐气 课件 五年级道德与法治下册 统编版
- 《学前教育法》知识培训
- DB37╱T 3844-2019 建筑石料矿绿色矿山建设规范
- 《孙权劝学》历年中考文言文阅读试题40篇(含答案与翻译)(截至2024年)
- 2024-2025学年人教版英语七年级下册Unit 5 Here and now Section B 1a - 1d英文版教案
评论
0/150
提交评论