欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    超市收银课程设计.docx

    • 资源ID:9969098       资源大小:111.47KB        全文页数:28页
    • 资源格式: DOCX        下载积分:3金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    超市收银课程设计.docx

    1、超市收银课程设计目录1 设计时间 32 设计目的 33设计任务 33.1任务说明 33.2系统目标 33.3使用范围 34 设计内容 34.1界面构建 34.2详细设计 34.2.1模块设计 44.2.2运行调试 44.2.3部分源程序 85 总结与展望 28参考文献 29成绩评定 291 设计时间2011年6月11日-2011年6月15日2 设计目的通过实践加深学生对面向对象程序设计的理论、方法和基础知识的理解,掌握使用Java语言进行面向对象设计的基本方法,提高运用面向对象知识分析实际问题、解决实际问题的能力,提高学生的应用能力。3设计任务3.1任务说明设计出一个超市收银程序(1)使用图形

    2、用户界面实现。信息返回给收银台,计算出该顾客所购商品的总价格。(3)每天营业结束把该收银台的销售总额进行统计汇总(要求包括商品种类、数量、销售总额、结账人次等信息,其余可自行丰富)并存储在数据库中。(4)所有持卡顾客的消费商品情况存储到文件以供查询。(5)对没有卡的消费情况不记录该顾客的消费情况等个人信息。如果一个未持卡顾客一次购物满200元,结完账后系统提示可为其发放一张会员卡3.2系统目标该软件开发的用途是用来方便超市的收银管理,提高办事效率。3.3使用范围本程序用于超市对会员和非会员的销售管理4 设计内容 4.1界面构建为了便于各种操作,软件采用多窗口的模式。用户可在不同窗口进行相应操作

    3、。4.2详细设计4.2.1模块设计 4.2.2运行调试图1登录界面图2操作界面图3.1修改数量图3.2 填入要修改数量的商品号图3.3输入新数量图4.1 普通结算图4.2会员结算图5销售情况图6系统时间4.2.3部分源程序登录import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.StringTokenizer;

    4、import javax.swing.*;public class land public static void main(String args) landframe frame = new landframe(); frame.setTitle(收营员登陆); frame.setLocation(300,300); frame.setSize(270, 170); frame.setVisible(true); class landframe extends JDialog implements ActionListener public landframe() label1 = new

    5、 JLabel(JAVA超市收营系统 请登陆); label2 = new JLabel(用户名:); label3 = new JLabel(密码:); hbox1 = Box.createHorizontalBox(); hbox2 = Box.createHorizontalBox(); vbox = Box.createVerticalBox(); jf1 = new JTextField(); JPF= new JPasswordField(); JPF.addActionListener(this); land = new JButton(登陆); land.addActionLi

    6、stener(this); panel1 = new JPanel(); panel2 = new JPanel(); hbox1.add(label2); hbox1.add(Box.createHorizontalStrut(5); hbox1.add(jf1); hbox2.add(label3); hbox2.add(Box.createHorizontalStrut(18); panel2.add(land, Center); hbox2.add(JPF); vbox.add(label1); vbox.add(Box.createVerticalStrut(10); vbox.ad

    7、d(hbox1); vbox.add(Box.createVerticalStrut(10); vbox.add(hbox2); vbox.add(Box.createVerticalStrut(10); vbox.add(panel2); panel1.add(vbox); getContentPane().add(panel1, Center); public void actionPerformed(ActionEvent evt) Object source = evt.getSource(); if (source = land | source = JPF) / 登陆按纽及第二个文

    8、本输入框ENTER功能实现 String a = , b, read; boolean denglusuccees = false; try FileReader fr = new FileReader(denglu.txt); BufferedReader br = new BufferedReader(fr); while (read = br.readLine() != null) StringTokenizer sto = new StringTokenizer(read); a = sto.nextToken(); b = sto.nextToken(); if (jf1.getTe

    9、xt().equals(a) & JPF.getText().equals(b) denglusuccees = true; break; / 验证登陆员号码及密码 catch (IOException ie) System.err.println(ie.getMessage(); if (denglusuccees = true) setVisible(false); mainview mw = new mainview(); mw.setTitle(a + 为您服务); mw.setSize(850, 500); mw.setLocation(200, 180); mw.setVisibl

    10、e(true); else jf1.setText(); JPF.setText(); JOptionPane.showMessageDialog(null, 非法用户); private JLabel label1, label2, label3; private Box hbox1, hbox2, vbox; private JTextField jf1; private JPasswordField JPF; private JButton land; private JPanel panel1, panel2;物价计算public class draw double a; double

    11、 b; String c; public draw(double fnum, double all, String information) / 构造函数 a = fnum;/ 获得指定商品当销售额 b = all;/ 获得当天总销售额 c = information;/ 获得指定商品的编号 DrawJDialog frame = new DrawJDialog(); frame.setSize(400, 300); frame.setLocation(400, 300); frame.setVisible(true); class DrawJDialog extends JDialog im

    12、plements ActionListener/ 界面及功能实现 JButton shut; JTextArea one = new JTextArea(); DrawPanel panel = new DrawPanel(); shut = new JButton(关闭); shut.addActionListener(this); double rate = 100 * a / b; DecimalFormat df = new DecimalFormat(#.00); rate = Double.parseDouble(df.format(rate);/ 格式化小数显示 one.setT

    13、ext( + c + n + 占今天销售额 + rate + %); panel.add(one); panel.add(shut); Container contentPane = getContentPane(); contentPane.add(panel); setTitle(销售情况); public void actionPerformed(ActionEvent evt) Object source = evt.getSource(); setVisible(false); class DrawPanel extends JPanel/ 画饼图 public void paint

    14、Component(Graphics g) g.clearRect(30, 40, 150, 150); double x1 = a; double x2 = b; int angle; super.paintComponent(g); angle = (int) (360 * x1 / x2); g.setColor(Color.blue); g.drawArc(30, 100, 150, 150, 0, angle); g.fillArc(30, 100, 150, 150, 0, angle); g.setColor(Color.GREEN); g.drawArc(30, 100, 15

    15、0, 150, 0 + angle, 360 - angle); g.fillArc(30, 100, 150, 150, 0 + angle, 360 - angle); 应用操作import java.awt.event.*;import javax.swing.*;import javax.swing.event.*;import java.awt.*;import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.*;class mainview ex

    16、tends JFrame implements ActionListener DataManagement mydata = new DataManagement(); sellcount mysell = new sellcount(); judge myjudge = new judge(); int dcount = 1; public mainview() changeButton1 = new JButton(修改价格); changeButton1.addActionListener(this); changeButton1.setEnabled(false); changeBut

    17、ton2 = new JButton(修改数量); changeButton2.addActionListener(this); changeButton2.setEnabled(false); deleteButton = new JButton(删除商品); deleteButton.addActionListener(this); deleteButton.setEnabled(false); finishButton = new JButton(完成结算); finishButton.addActionListener(this); finishButton.setEnabled(fa

    18、lse); cheapButton = new JButton(会员结算); cheapButton.addActionListener(this); cheapButton.setEnabled(false); recordButton = new JButton(记录清单); recordButton.addActionListener(this); recordButton.setEnabled(false); moneyButton = new JButton(找零计算); moneyButton.addActionListener(this); moneyButton.setEnab

    19、led(false); clearButton = new JButton(清除清单); clearButton.addActionListener(this); textAll = new JTextField(0); textAll.setEditable(false); textAll.setBorder(BorderFactory.createEtchedBorder(); textChange = new JTextArea(7, 0); textChange.setEditable(false); textChange.setBorder(BorderFactory.createE

    20、tchedBorder(); hbox2 = Box.createHorizontalBox(); vbox2 = Box.createVerticalBox(); vbox2.add(Box.createVerticalStrut(9); vbox2.add(changeButton1); vbox2.add(Box.createVerticalStrut(9); vbox2.add(changeButton2); vbox2.add(Box.createVerticalStrut(9); vbox2.add(deleteButton); vbox2.add(Box.createVertic

    21、alStrut(9); vbox2.add(finishButton); vbox2.add(Box.createVerticalStrut(9); vbox2.add(cheapButton); vbox2.add(Box.createVerticalStrut(9); vbox2.add(textAll); vbox2.add(moneyButton); vbox2.add(textChange); vbox2.setBorder(BorderFactory.createEtchedBorder(); textArea = new JTextArea(24, 37); textArea.s

    22、etMaximumSize(textArea.getPreferredSize(); textArea.setEditable(false); scrollPane = new JScrollPane(textArea); textAdd = new JTextField(20); textAdd.addActionListener(this); vbox1 = Box.createVerticalBox(); hbox1 = Box.createHorizontalBox(); label1 = new JLabel(此处输入商品编号 ); label2 = new JLabel(商品信息显

    23、示:); drawButton = new JButton(单天商品销售情况); drawButton.addActionListener(this); vbox1.add(label1); vbox1.add(textAdd); hbox1.add(label2); hbox1.add(drawButton); vbox1.add(hbox1); vbox1.add(scrollPane); vbox1.setBorder(BorderFactory.createLoweredBevelBorder(); vbox3 = Box.createVerticalBox(); hbox3 = Bo

    24、x.createHorizontalBox(); label3 = new JLabel(最终清单); label4 = new JLabel(版权所属); label4.setBorder(BorderFactory.createEtchedBorder(); textFinish = new JTextArea(24, 30); textFinish.setEditable(false); textFinish.setBorder(BorderFactory.createEtchedBorder(Color.WHITE, Color.BLACK); hbox3.add(recordButt

    25、on); hbox3.add(Box.createHorizontalStrut(10); hbox3.add(clearButton); hbox3.add(Box.createHorizontalStrut(10); hbox3.add(label4); vbox3.add(new clock(); vbox3.add(label3); hbox3.setBorder(BorderFactory.createEtchedBorder(); vbox3.add(textFinish); vbox3.add(hbox3); vbox3.setBorder(BorderFactory.creat

    26、eLoweredBevelBorder(); hbox2.add(vbox1); hbox2.add(vbox2); hbox2.add(vbox3); getContentPane().add(hbox2); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit(0); ); public void actionPerformed(ActionEvent evt) Object source = evt.getSource(); if (source = textA

    27、dd) / 商品添加 String log = textAdd.getText(); StringTokenizer sto = new StringTokenizer(log); String dcode = sto.nextToken(); boolean inputwrite = true; int dnum = 1; if (sto.hasMoreTokens() try int tempnum=Integer.parseInt(sto.nextToken(); if(tempnum0)dnum = Integer.parseInt(sto.nextToken(); else inpu

    28、twrite=false; catch (NumberFormatException e) JOptionPane.showMessageDialog(null, 请输入数字); inputwrite = false; if (inputwrite = true) if (myjudge.find(dcode) = -1) String wrong = Cant find + dcode; JOptionPane.showMessageDialog(null, wrong); textAdd.setText(); else int location = myjudge.find(dcode);

    29、 String dname = myjudge.judgeDatalocation.getName(); double dprice = myjudge.judgeDatalocation.getPrice(); mydata.add(dcode, dname, dprice, dnum); textArea.setText(); for (int i = 0; i mydata.acount; i+) textArea.insert(商品 + (i + 1) + 编号: + mydata.productDatai.getCode() + 商品名称: + mydata.productDatai.getName() + 商品价格: + mydata.productDatai.getPrice() + 元/单位 + mydata.productDatai.getNum() + 个


    注意事项

    本文(超市收银课程设计.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开