感想:
 在那一天下午气喘吁吁的上了六楼 在建民的课上 都要带电脑 第一次上这样的课,每一次都是个段子 ,这一次考试是学前考试,什么也不知道 ,但是通过百度,
发现JAVA有很多还都和C语言相似的地方 ,例如循环语句和他的思想,但是,也有好多不一样,例如头文件,建类方式,还有函数建立的方法,和输入输出不同,
但是他的输出我感觉比C更加人性化例如System.out.println("写数据成功!");
他的是用+号来彼此连接,所以这样就不用分行,但也同时需要双引号 其没有输入函数 需要自己设置,大多用的是 
Scanner scan=new Scanner(System.in);
             String l;
             l=scan.next();
同时他和C相同次与C++ 针对不同数据类型有着不同的next
所以在这一点 我认为这是JAVA的弱点  同时 JAVA有着许多头文件 用包来封装再在包里建类 这是一个进步,能让程序更加地清晰,让每一个接口都清晰,所以JAVA更适合编写网站,完美地处理网站
根据临时学师
发现自己还有很多的问题
例如:
搞不懂类的建立 用类建立结构体 
再者
数据库地建立
和用数据库来进行数据的匹配  
这些都是十分重要地知识 但是一点都不懂
因为如果建立数据库 那么数据库里的数据,每一个信息 都是每一个有效地信息,就不用再挨个打出来,节约了大把地时间和存储空间,这就让网站地速度更快
也更加优化用户地体验
这就是数据库地迷人的地方。同时也还是JAVA地重要地地方,很重要,日后一定要努力加强
 
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Account {
 static int M=0,N=0;
  private String accountID;//存储账号
  private String accountname;//账户名称
  private String operatedate;//2018-09-20
  private int operatetype;//操作账户类型(1,存款2,取款3,转账汇款4,修改账户密码5,查询余额
  private String accountpassword;//用户密码
  private int accountbalance;//存储账户余额 0
  private int amount;//流水金额
  void setaccountID(String t)
  {
   accountID=t;
  }
  void setaccountname(String t)
  {
   accountname=t;
  }
  void setoperatedate(String t)
  {
   operatedate=t;
  }
  void setoperatetype(int t)
  {
   operatetype=t;
  }
  void setaccountpassword(String t)
  {
   accountpassword=t;
  }
  void setaccountbalance(int t)
  {
   accountbalance=t;
  }
  void amount(int t)
  {
   amount=t;
  }
  String getaccountID()
  {
   return accountID;
  }
  String getaccountname()
  {
   return accountname;
  }
  String getoperatedate()
  {
   return operatedate;
  }
  int getoperatetype()
  {
   return operatetype;
  }
  String getaccountpassword()
  {
   return accountpassword;
  }
  int getaccountbalance()
  {
   return accountbalance;
  }
  int getamount()
  {
   return amount;
  }
  Account(String AaccountID,String Aaccountname,String Aoperatedate,int Aoperatetype,String Aaccountpassword,int Aaccountbalance,int Aamount)
  {
   accountID=AaccountID;
   accountname=Aaccountname;
   operatedate=Aoperatedate;
   operatetype=Aoperatetype;
   accountpassword=Aaccountpassword;
   accountbalance=Aaccountbalance;
   amount=Aamount;
  }
 
    public static void main(String[]args)
    {
     Account[] a1=null;
     a1=new Account[6];
     a1[0]=new Account("20173599","zhoubo","2018-09-20",1,"753951",0,0);
     a1[1]=new Account("20173598","zhoubo","2018-09-20",1,"753951",0,0);
     a1[2]=new Account("20173597","zhoubo","2018-09-20",1,"753951",0,0);
     a1[3]=new Account("20173596","zhoubo","2018-09-20",1,"753951",0,0);
     a1[4]=new Account("20173595","zhoubo","2018-09-20",1,"753951",0,0);
     File file = null;
        FileWriter fw = null;
        file = new File("E:\\eclipse-workspace\\信 1705-1班 20173599 周博\\accountinformation.txt");
        try {
          if (!file.exists()) {
                 file.createNewFile();
             }
          fw=new FileWriter(file);
          for(int i=0;i<5;i++)
          {
           fw.write(a1[i].accountID+a1[i].accountname+a1[i].accountpassword+a1[i].accountbalance);
           fw.flush();
          }
          System.out.println("写数据成功!");
        }
        catch (IOException e) {
            e.printStackTrace();
    }
        finally {
         if(fw!=null)
         {
          try {
           fw.close();
          }catch (IOException e)
          {
           e.printStackTrace();
          }
         }
        }
        File file1 = null;
        FileWriter fw1 = null;
        file1 = new File("E:\\eclipse-workspace\\信 1705-1班 20173599 周博\\accountinformation.txt");
        try {
          if (!file1.exists()) {
                 file1.createNewFile();
             }
          fw1=new FileWriter(file1);
          for(int i=0;i<5;i++)
          {
           fw1.write(a1[i].accountID+a1[i].accountname+a1[i].accountpassword+a1[i].accountbalance);
           fw1.flush();
          }
          System.out.println("写数据成功!");
        }
        catch (IOException e) {
            e.printStackTrace();
    }
        finally {
         if(fw1!=null)
         {
          try {
           fw1.close();
          }catch (IOException e)
          {
           e.printStackTrace();
          }
         }
        }
        Shuru_zhanghao(a1);
        Shuru_mima(a1);
        M=2;
        if(M==-2)
        {
         System.out.println("您有三次机会 如果全错将被没收");
         for(int i=1;i<=3;i++)
         {
             Scanner scan=new Scanner(System.in);
             String l;
             l=scan.next();
             if(l!=a1[N].accountpassword)
             {
              System.out.println("您错了"+i+"次");
              if(i==3) {
               System.out.println("该账号三次录入密码错误,该卡已被系统没收,请与工行及时联系处理");
               break;}
             }
             else break;
         }
        }
          if(M==2)
          {    char ch='y';
         while(ch=='y')
          {
              System.out.println("***************************************************************");
              System.out.println("\t欢迎"+a1[N].accountname+"使用中国工商银行自助柜员系统 ");
              System.out.println("***************************************************************");
              System.out.println("\t1、 存款");
              System.out.println("\t2、 取款:");
              System.out.println("\t3、 转账汇款:");
              System.out.println("\t4、 修改密码:");
              System.out.println("\t5、 查询余额:");
              System.out.println("\t6、 退出:");
             Scanner scan=new Scanner(System.in);/*输入  等待输入*/
             int sc5=scan.nextInt();//输入的值
             switch(sc5)
             {
             case 1:
                {
                 Cunkuan(a1); 
                    break;
                }
             case 2:
             {
              Cunkuan(a1);
              break;
             }
             case 5:
             {
              Cha_yu(a1);
             }
             case 6:
             {
              break;
             }
             }
          }
        
          } 
    }
    static void  Cha_yu(Account [] a)
    {
     System.out.println("\t当前余额为:");
     System.out.println(a[N].accountbalance);
    }
    static void  Qukuan(Account [] a)
    {
     System.out.println("******************************************************");
     System.out.println("\t欢迎zhoubo使用中国银行自助柜员系统");
     System.out.println("******************************************************");
     System.out.println("\t请输入取款金额:");
     Scanner in=new Scanner(System.in);
     int O;
      O=in.nextInt();
      a[N].amount=O;
     a[N].accountbalance=a[N].accountbalance-a[N].amount;
     System.out.println("\t当前账户存款操作成功");
     System.out.println("\t当前余额为:");
     System.out.println(a[N].accountbalance);
    }
    static void Cunkuan(Account [] a)
    {
     System.out.println("******************************************************");
     System.out.println("\t欢迎"+a[N].accountname+"o使用中国银行自助柜员系统");
     System.out.println("******************************************************");
     System.out.println("\t请输入存款金额:");
     Scanner in=new Scanner(System.in);
     int O;
      O=in.nextInt();
      a[N].amount=O;
      System.out.println("******************************************************");
      System.out.println("\t当前账户存款操作成功");
      System.out.println("\t当前余额为:");
      a[N].accountbalance+=a[N].amount;
      System.out.println(a[N].accountbalance);
    }
    static void Shuru_zhanghao(Account [] a)
    {
     System.out.println("******************************************************");
     System.out.println("\t欢迎"+a[N].accountname+"使用中国工商银行自动柜员系统");
     System.out.println("******************************************************");
     System.out.println("\t请输入您的账号:");
     Scanner in=new Scanner(System.in);
     String O;
      O=in.next();
      System.out.println("******************************************************");
      for(int i=0;i<5;i++)
      {
       if(O==a[i].accountID)
       {
        M=1;N=i;
       }
       else {System.out.println("输入正确!");M=-1;}
      }
    }
    static void Shuru_mima(Account [] a)
    {
     System.out.println("******************************************************");
     System.out.println("\t欢迎"+a[N].accountname+"使用中国银行自助柜员系统");
     System.out.println("******************************************************");
     System.out.println("\t请输入您的密码:");
     Scanner in=new Scanner(System.in);
     String O;
      O=in.next();
      System.out.println("******************************************************");
       if(O==a[N].accountpassword)
       {
        M=2;
       }
       else {System.out.println("输入正确!");M=-2;}
    }
}

简单ATM机功能实现及感想的更多相关文章

  1. 连接数据库——模拟ATM机查、存、取、开户功能

    1.界面:包含开户.查询.存款.取款.功能 package com.bank.test; /** * * @author Administrator *界面类 */ public class Jiem ...

  2. 简单的小程序实现ATM机操作

    简单的小程序实现ATM机操作 代码如下: package Day06; import java.util.Scanner; public class TestAccount { public stat ...

  3. 模拟ATM机银行系统

    淄博汉企Java基础考核项目 模拟银行自助终端系统 一. 本系统模拟银行用户使用ATM机开户.查询.存款.取款功能,要求使用java语言编程实现. 说明: 1. 对于数据输入异常,可使用java异常处 ...

  4. JAVA - ATM机程序

    ATM机程序 UnionPayTest.java package oo.day06.work; public class UnionPayTest { } interface UnionPay{ // ...

  5. 第一次尝试使用JAVA编写的ATM机程序

    package study; import java.util.Scanner; public class ATM { private static int[] users = { 111111, 2 ...

  6. 练习题:试使用C#编程实现银行、ATM等功能

    练习题:试使用编程实现银行.ATM等功能 using System; using System.Collections.Generic; using System.Linq; using System ...

  7. 简易ATM机

    简易ATM机(代码如下): /* * 功能:简易银行系统 */package day8; import java.util.Scanner; /** * * @FengYan Huang Admini ...

  8. python实现atm机基本操作及购物车

    一.需求分析 ATM机要为用户提供转账,提现,还款,付款,消费流水,操作记录等操作接口 ATM机要为管理员提供创建用户,冻结解冻,修改额度的功能 ATM机管理员认证使用装饰器来实现 购物车要提供管理员 ...

  9. 多用户ATM机(面向对象编程)

    let readline = require('readline-sync'); // 清屏函数 let clear = () => process.stdout.write(process.p ...

随机推荐

  1. HBase与Zookeeper数据结构查询

    一.前言 最近一年了吧,总是忙于特定项目的业务分析和顶层设计,很少花时间和精力放到具体的技术细节,感觉除了架构理念和分析能力的提升,在具体技术层次却并没有多大的进步.因为一些原因,总被人问及一些技术细 ...

  2. java线程之间的通信

    1.常用的方法 sleep() 该线程进入等待状态,不释放锁 wait() 该线程进入等待状态,释放锁 notify() 随机唤醒一个线程 notifyAll() 唤醒全部线程 getName() 获 ...

  3. LeetCode——9. Palindrome Number

    一.题目链接:https://leetcode.com/problems/palindrome-number/ 二.题目大意: 给定一个整数,判断它是否为一个回文数.(例如-12,它就不是一个回文数: ...

  4. Netty简单的HTTP服务器

    本文转载自:https://www.cnblogs.com/luangeng/p/7875710.html HTTP协议:略 基于Netty的HTTP协议栈可以方便的进行异步非阻塞的HTTP服务器的开 ...

  5. bzoj4183: tree

    Description 自底向上模拟,原地操作以节省空间 #include<bits/stdc++.h> unsigned n,a,b,c,v[],mx,ans=; int main(){ ...

  6. P1507 NASA的食物计划

    传送 01背包又进化了,它变成了二维背包. 既然它多了一个维度,那么我们的f[j]也变成了二维数组f[i][j],其中i表示费用1,j表示费用2 核心方程也相应的变成了f[i][j]=max(f[i- ...

  7. scala 基本类型和操作

    Scala基本类型 Scala中的基本数据类型如下图:  (来源:Programming in scala) 从上表中可以看出,Scala的基本数据类型与Java中的基本数据类型是一一对应的,不同的是 ...

  8. blog决定不用二级域名,改为二级目录

    看了一篇文章,受益匪浅,到底是用二级域名还是二级目录?已转载到得闲佬设计. 分析了一下得闲佬设计的因素,因为得闲佬设计是小站,流量很小,而且更新文章频率也不大,没必要把流量分出去做一个独立的站点 所以 ...

  9. eclipse调试的时候怎么后退?

    原文转载至:https://blog.csdn.net/qq_21262611/article/details/52121270 个人分类: myeclipse   前些天和同事交流调试技巧时,知道了 ...

  10. Android Gradle插件(plugin)版本(version)与Gradle、SDK Build Tools版本关系

    具体关系如下图: 比如,Android Studio 2.0发布,其中有个新功能“Instant Run”,需要Android Gradle Plugin版本2.0.0以上,那么我们项目的.gradl ...