手机版

Java实习报告(ATM自动柜员机)

时间:2025-05-11   来源:未知    
字号:

JAVA

一、实习目的

1、将所学知识进行一个系统的联系。

2、培养学生分析问题和解决问题的能力,为学生提供了独立实践的机会。 3、理论联系实际,巩固所学知识,提高学生处理处理实际问题的能力。 4、进一步培养学生面向对象程序设计的思想。

5、将所学知识与社会实际现象相联系,使学生更清楚java的用途。

二、实习地点

安康学院经济与管理系7405实验室

三、实习内容

1、题目

ATM自动柜员机模拟程序 2、功能介绍

ATM自动柜员机包括以下操作内容:

修改账号密码、余额查询、ATM取款、ATM存款

四、实习过程

1、选题阶段

根据自己的学习情况和个人爱好选择要设计的内容,经过反复判断抉择我最后的实习项目选择是:ATM自动柜员机模拟程序 2、分析题目要求的功能阶段

针对题目和现实情况列出程序的功能,然后对每一个功能进行分析,画出草图,并列出每一个功能能的要

账号登陆:银行账号和初始密码为“123456”

修改密码:旧密码等于原密码,新密码必须不小于6位,并且新密码两次输入的一致 查询余额:初始余额为10000元

ATM取款:取款的金额必须为100的倍数,不大于5000元,并且不能大于余额 ATM存款:存款的金额不能为负数 3、制定方案阶段

画出每一个功能模块的草图 1)

附录1:

ATM自动柜员机模拟程序代码如下:ATM.java程序

import java.awt.*; import javax.swing.*; import java.awt.event.*;

public class ATM extends JFrame implements ActionListener{

private void buildConstraints(GridBagConstraints gbc, int gx, int gy, int gw, int gh, int wx, int wy) {

gbc.gridx=gx; gbc.gridy=gy; gbc.gridwidth=gw; gbc.gridheight=gh; gbc.weightx=wx; gbc.weighty=wy; }

//第一个窗口 变量:ATM自动柜员模拟登陆 JFrame frame1;

JLabel lb1,lb2,lb3,lb4,zh,mm; JTextField text1; JPasswordField text2; JPanel pane;

JButton bt1,bt2,bt3;

//第二个窗口变量 :选择业务 JFrame frame2; JPanel p1,p2,pq3;

JButton b1,b2,b3,b4,b5,b6; //第三个窗口 变量:修改密码 JFrame frame3;

JLabel lbe1,lbe2,lbe3,cw1,cw2,cw3; JButton button1,button2,button3; JPasswordField tf1,tf2,tf3; //第四个窗口 变量:查询余额 JFrame frame4; JLabel label,tt,tt1; JButton bb1,bb2;

//第五个窗口 变量:ATM取款 JFrame frame5; JLabel aa,bb,ww1; JTextField ff; JPanel pp;

JButton qq1,qq2,qq3;

//第六个窗口 变量:ATM存款 JFrame frame6;

JLabel w1,w2,ww; JTextField f; JPanel p3;

JButton q1,q2,q3; ATM(){

//第一个窗口界面设计:ATM自动柜员模拟登陆 frame1=new JFrame("模拟ATM柜员机"); frame1.setSize(400, 200); frame1.setLocation(300, 200); frame1.setResizable(false);

GridBagLayout gridbag=new GridBagLayout();

GridBagConstraints constraints=new GridBagConstraints(); constraints.fill=GridBagConstraints.CENTER; constraints.insets=new Insets(2,2,2,2); frame1.setLayout(gridbag);

lb1=new JLabel("请输入您的银行卡号:"); lb4=new JLabel("");

text1=new JTextField(10);

lb2=new JLabel("请输入您的银行卡密码:"); text2=new JPasswordField(10); text2.setEchoChar('●'); lb3=new JLabel("");

zh=new JLabel("123456"); zh.setVisible(false);

mm=new JLabel("123456"); mm.setVisible(false); pane=new JPanel();

bt1=new JButton("更正"); bt2=new JButton("确定"); bt3=new JButton("退出"); pane.add(bt1); pane.add(bt2); pane.add(bt3);

buildConstraints(constraints,0,0,1,1,20,25); gridbag.setConstraints(lb1, constraints); frame1.add(lb1);

buildConstraints(constraints,1,0,1,1,40,20); gridbag.setConstraints(text1, constraints); frame1.add(text1);

buildConstraints(constraints,1,1,1,1,20,12); gridbag.setConstraints(lb4, constraints);

frame1.add(lb4);

buildConstraints(constraints,0,1,1,1,20,12); gridbag.setConstraints(zh, constraints); frame1.add(zh);

buildConstraints(constraints,0,2,1,1,20,5); gridbag.setConstraints(lb2, constraints); frame1.add(lb2);

buildConstraints(constraints,1,2,1,1,40,10); gridbag.setConstraints(text2, constraints); frame1.add(text2);

buildConstraints(constraints,1,3,1,1,20,12); gridbag.setConstraints(lb3, constraints); frame1.add(lb3);

buildConstraints(constraints,0,3,1,1,20,12); gridbag.setConstraints(mm, constraints); frame1.add(mm);

buildConstraints(constraints,1,4,1,1,20,5); gridbag.setConstraints(pane, constraints); frame1.add(pane);

bt1.addActionListener(this); bt2.addActionListener(this); bt3.addActionListener(this);

pack();

frame1.setVisible(true);

//第二个窗口界面设计:选择业务 frame2=new JFrame("选择业务"); frame2.setSize(400, 200); frame2.setLocation(300, 200); frame2.setResizable(false); p1=new JPanel(); p2=new JPanel(); p3=new JPanel();

b1=new JButton("修改密码"); b2=new JButton("查询余额"); b3=new JButton("我要取款"); b4=new JButton("我要存款");

b5=new JButton("退出"); b6=new JButton("返回"); p1.add(b1); p1.add(b2); p2.add(b3); p2.add(b4); p3.add(b6); p3.add(b5);

frame2.add(p1,BorderLayout.NORTH); frame2.add(p2,BorderLayout.CENTER); frame2.add(p3,BorderLayout.SOUTH);

b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); b4.addActionListener(this); b6.addActionListener(this); b5.addActionListener(this);

//第三个窗口界面设计:修改密码 frame3=new JFrame("修改密码"); frame3.setSize(400, 1 …… 此处隐藏:10916字,全部文档内容请下载后查看。喜欢就下载吧 ……

Java实习报告(ATM自动柜员机).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
    ×
    二维码
    × 游客快捷下载通道(下载后可以自由复制和排版)
    VIP包月下载
    特价:29 元/月 原价:99元
    低至 0.3 元/份 每月下载150
    全站内容免费自由复制
    VIP包月下载
    特价:29 元/月 原价:99元
    低至 0.3 元/份 每月下载150
    全站内容免费自由复制
    注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
    × 常见问题(客服时间:周一到周五 9:30-18:00)