package ATM;
import java.util.Scanner;
/**
 * 操作学生数据
 * 
 * @author Administrator
 *
 */ 
public class AccountManager { 
  static Scanner sc = new Scanner(System.in);
  
    
  
     /**
      * 主菜单
      */ 
     public static void menu()
     {
     System.out.println("*********************************");
     System.out.println("欢迎使用中国工商银行自助系统");
     System.out.println("*********************************");
     System.out.println("请输入您的帐号:");
     System.out.println("*********************************");
     int flag=1;
     while(flag==1)
     {
     String num= sc.next();
     if(num.length()!=8)
     {System.out.println("输入错误,请重新输入");
      flag=1;
     }
     else flag=0;
     }
     if(flag==0)
      
      {System.out.println("*********************************");
      System.out.println("欢迎使用中国工商银行自助系统");
      System.out.println("*********************************");
      System.out.println("请输入您的密码:");
      System.out.println("*********************************");
      }
     int index=1;
      for(int i=0;i<3;i++)
      {
      String word=sc.next();
      if(word.length()!=6)
      {System.out.println("输入错误,请重新输入");
      index=0;
      }
      else break;
      }
      if(index==0)
       System.out.println("输入密码三次错误,卡已被没收");
      }
     
      }
 
 
package ATM;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
public class read
{
 
  
  
   
 
     public static ArrayList<String> accountID= new ArrayList<String>();
  public static ArrayList<String> accountname = new ArrayList<String>();
  public static ArrayList<String> accountpssword= new ArrayList<String>(); 
     public static ArrayList<Integer> accountbalance = new ArrayList<Integer>();
     public static File file = new File("D:\\accountinformation.txt");
 
     static { 
  
         ArrayList<String> temp = new ArrayList<String>(); 
         try { 
             BufferedReader br = new BufferedReader(new FileReader(file)); 
  
             String read = br.readLine(); 
             while (read != null) { 
                 temp.add(read); 
                 read = br.readLine(); 
             } 
             br.close(); 
         } catch (FileNotFoundException e) { 
             // TODO Auto-generated catch block 
             e.printStackTrace(); 
         } catch (IOException e) { 
             // TODO Auto-generated catch block 
             e.printStackTrace(); 
         } 
  
         for (int i = 0; i < temp.size(); i++) { 
             String[] sTemp = ((String) temp.get(i)).split(","); 
    accountID.add(sTemp[0]); 
             accountname.add(sTemp[1]); 
             accountpssword.add(sTemp[2]);
       
             accountbalance.add(Integer.parseInt(sTemp[3])); 
         } 
  
     } 
  
 } 
 
 
 
 
package ATM;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
public class read2
{
 
  
  
   
 
     public static ArrayList<String> accountID= new ArrayList<String>();
  public static ArrayList<String> accountname = new ArrayList<String>();
  public static ArrayList<String> operatedate= new ArrayList<String>(); 
     public static ArrayList<Integer> operatetype = new ArrayList<Integer>();
     public static ArrayList<Integer> amount = new ArrayList<Integer>();
     public static File file = new File("D:\\accountlist.txt");
 
     static { 
  
         ArrayList<String> tem = new ArrayList<String>(); 
         try { 
             BufferedReader cr = new BufferedReader(new FileReader(file)); 
  
             String read = cr.readLine(); 
             while (read != null) { 
                 tem.add(read); 
                 read = cr.readLine(); 
             } 
             cr.close(); 
         } catch (FileNotFoundException e) { 
             // TODO Auto-generated catch block 
             e.printStackTrace(); 
         } catch (IOException e) { 
             // TODO Auto-generated catch block 
             e.printStackTrace(); 
         } 
  
         for (int i = 0; i < tem.size(); i++) { 
             String[] sTemp = ((String) tem.get(i)).split(","); 
    accountID.add(sTemp[0]); 
             accountname.add(sTemp[1]); 
             operatedate.add(sTemp[2]);
       
             operatetype.add(Integer.parseInt(sTemp[3])); 
             amount.add(Integer.parseInt(sTemp[4]));
         } 
  
     } 
  
 } 
 
 
package ATM;
public class test {
 public static void main(String[] args)
 {
  AccountManager.menu();
  // TODO Auto-generated method stub
 }
}

java考试的更多相关文章

  1. 2018.6.20 Java考试试题总结(Java语言基础与面向对象编程)最新版

    Java考试试题总结 一.单选题(每题1分 * 50 = 50分) 1.java程序的执行过程中用到一套JDK工具,其中javac.exe指( B ) A.java语言解释器 B.java字节码编译器 ...

  2. java 考试试题

    Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语法,集合的语法,io 的语法,虚拟机方面的语法,其他.有些题来自网上搜集整理,有些题来自学员 ...

  3. java考试感受

    开学不久,我们进行了一次java程序考试.在此之前,老师要求我们在假期自学java并提前发了一个考试样卷,要求用数组编写一个学生信息管理系统并能够实现一系列的功能.由于我早早的便完成了这道题.因此对这 ...

  4. 开学第一课Java考试

    package moguiba;import java.text.DecimalFormat;import java.util.Scanner;import moguiba.ScoreInformat ...

  5. java考试易错题大全

    常见的Java问题 1.什么是Java虚拟机?为什么Java被称作是"平台无关的编程语言"? Java虚拟机是一个可以执行Java字节码的虚拟机进程.Java源文件被编译成能被Ja ...

  6. java开学考试感想及代码

    上周四我们的第一节java课,王老师给我们进行啦开学考试,这也是上学期放假之前给我们约定好的 但是情况显然没有我想的那么好,其实我觉得这个atm系统比上届学生信息管理系统难的多,上届的话毕竟有小学期的 ...

  7. java中可定制的序列化过程 writeObject与readObject

    来源于:[http://bluepopopo.iteye.com/blog/486548] 什么是writeObject 和readObject?可定制的序列化过程 这篇文章很直接,简单易懂.尝试着翻 ...

  8. java抽象-老师的生日-逻辑思维-有趣的面试题-遁地龙卷风

    (-1)写在前面 都快去北京了,硬生生的安排一场java考试,对于那些特别细节的东西我忘了吧也不觉得有什么不好,以前都记得,也都见过,只不过平时不常用连接断了,但是你死记硬背是没用的,一段时间后还是会 ...

  9. Java 第7章 数组

    第七章 (数组) 为什么需要数组 java 考试结束后,老师给张浩分配了一项任务,让他计算全班(30人)的平均分 int stu1=95; int stu2=95; int stu3=95; int ...

随机推荐

  1. RapidIOIP核的验证方法研究_王玉欢

    RapidIOIP核的验证方法研究_王玉欢 https://wenku.baidu.com/view/0fd3c925d4d8d15abf234e73.html

  2. [转]js 获取浏览器高度和宽度值(多浏览器)(js获取宽度高度大全)

    IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.d ...

  3. Nginx HttpSubModule sub_filter模块的过滤功能

    Nginx HttpSubModule sub_filter模块的过滤功能 发表于2年前(2013-08-05 10:39)   阅读(1481) | 评论(0) 0人收藏此文章, 我要收藏 赞0 5 ...

  4. c++ istream(ostream)是如何转换为bool的

    http://www.cplusplus.com/reference/ios/ios/operator_not/ http://stackoverflow.com/questions/8117566/ ...

  5. GoWeb编程之HelloWorld

    使用Go实现我们的第一个Web服务器程序 package main import "net/http" import "fmt" //打印HelloWorld ...

  6. apache gzip

    1.首先启动模块mod_deflate.so和mod_headers.so 2.httpd.conf #文件缓存时间配置<FilesMatch ".(flv|gif|jpg|jpeg| ...

  7. 关于 SQLNET.AUTHENTICATION_SERVICES 验证方式的说明

    今天去客户那里巡检,客户提出为了提高数据库安全性考虑,须要改动sys/systempassword,并通过数据库验证方式来代替默认的操作系统方式,如今我来把这两种验证方式总结一下. 操作系统验证.即通 ...

  8. ASP.NET动态网站制作(28)-- 三层框架(2)

    前言:三层框架的第二节课,继续上次课的内容. 内容: 1.三层框架的使用目的:可以将视图层和业务逻辑层及实体层分开,可以提高代码的扩展性,安全性,可以实现程序的低耦合性. 2.GetModel方法及G ...

  9. WPF命令绑定 自定义命令

    WPF的命令系统是wpf中新增加的内容,在以往的winfom中并没有.为什么要增加命令这一块内容.在winform里面的没有命令只使用事件的话也可以实现程序员希望实现的功能.这个问题在很多文章中都提到 ...

  10. git分支管理与冲突解决(转载)

    Git 分支管理和冲突解决 原文:http://www.cnblogs.com/mengdd/p/3585038.html 创建分支 git branch 没有参数,显示本地版本库中所有的本地分支名称 ...