java考试
import java.util.Scanner;
* 操作学生数据
*
* @author Administrator
*
*/
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("输入密码三次错误,卡已被没收");
}
}
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
{
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]);
accountbalance.add(Integer.parseInt(sTemp[3]));
}
}
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
{
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]);
operatetype.add(Integer.parseInt(sTemp[3]));
amount.add(Integer.parseInt(sTemp[4]));
}
}
{
AccountManager.menu();
// TODO Auto-generated method stub
java考试的更多相关文章
- 2018.6.20 Java考试试题总结(Java语言基础与面向对象编程)最新版
Java考试试题总结 一.单选题(每题1分 * 50 = 50分) 1.java程序的执行过程中用到一套JDK工具,其中javac.exe指( B ) A.java语言解释器 B.java字节码编译器 ...
- java 考试试题
Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语法,集合的语法,io 的语法,虚拟机方面的语法,其他.有些题来自网上搜集整理,有些题来自学员 ...
- java考试感受
开学不久,我们进行了一次java程序考试.在此之前,老师要求我们在假期自学java并提前发了一个考试样卷,要求用数组编写一个学生信息管理系统并能够实现一系列的功能.由于我早早的便完成了这道题.因此对这 ...
- 开学第一课Java考试
package moguiba;import java.text.DecimalFormat;import java.util.Scanner;import moguiba.ScoreInformat ...
- java考试易错题大全
常见的Java问题 1.什么是Java虚拟机?为什么Java被称作是"平台无关的编程语言"? Java虚拟机是一个可以执行Java字节码的虚拟机进程.Java源文件被编译成能被Ja ...
- java开学考试感想及代码
上周四我们的第一节java课,王老师给我们进行啦开学考试,这也是上学期放假之前给我们约定好的 但是情况显然没有我想的那么好,其实我觉得这个atm系统比上届学生信息管理系统难的多,上届的话毕竟有小学期的 ...
- java中可定制的序列化过程 writeObject与readObject
来源于:[http://bluepopopo.iteye.com/blog/486548] 什么是writeObject 和readObject?可定制的序列化过程 这篇文章很直接,简单易懂.尝试着翻 ...
- java抽象-老师的生日-逻辑思维-有趣的面试题-遁地龙卷风
(-1)写在前面 都快去北京了,硬生生的安排一场java考试,对于那些特别细节的东西我忘了吧也不觉得有什么不好,以前都记得,也都见过,只不过平时不常用连接断了,但是你死记硬背是没用的,一段时间后还是会 ...
- Java 第7章 数组
第七章 (数组) 为什么需要数组 java 考试结束后,老师给张浩分配了一项任务,让他计算全班(30人)的平均分 int stu1=95; int stu2=95; int stu3=95; int ...
随机推荐
- Atitit 文件上传 架构设计 实现机制 解决方案 实践java php c#.net js javascript c++ python
Atitit 文件上传 架构设计 实现机制 解决方案 实践java php c#.net js javascript c++ python 1. 上传的几点要求2 1.1. 本地预览2 1.2 ...
- 83. Remove Duplicates from Sorted List【easy】
83. Remove Duplicates from Sorted List[easy] Given a sorted linked list, delete all duplicates such ...
- 李洪强-HEAD 和nil和NULL
- python 转化文件编码 utf8
使用visual studio最大的一个问题就是文件编码问题,当文件中有中文时,visual studio 会默认为区域编码,也就是gb2312,如果想跨平台或者不用vs编译的话,就会因为编码问题导致 ...
- c#的bug?
在群里面有人提出了这么一个诡异的问题,请问15.5%3.1=? 然后,我就去看了看,因为他们说结果是3.1!!!
- c++中sin,cos,arcsin等和在C/C++中使用pi (π) 值
先 #include<math.h> 反3角函数有 acos(double),asin(double),atan(double),atan(double,double),返回值 doubl ...
- Python+selenium打开或关闭浏览器
Python+selenium打开或关闭浏览器 一.打开或关闭火狐浏览器 1. 初始化一个webdriver实例对象driver,然后打开和关闭firefox浏览器.要用selenium打 ...
- Eclipse调试部分手机不显示日志问题解决
在拨号键盘输入一串指令,然后会进入到工程模式,最后可以在Log设置里面设置了. 华为:*#*#2846579#*#* 酷派:*20121220#
- 辛星教你高速掌握PHP的正則表達式
首先说一下,这篇文章也是我在看了数个大牛的博客之后总结出来的,因此首先向这些大牛表示崇高的敬意和感谢,因为人数众多.并且来源也是特别分散,就不一一介绍了,见谅. ************跨语言的主题* ...
- JDK之ThreadLocal分析
ThreadLocal是在是Thread的一个局部变量,今天我来分析了一下这个类 先看ThreadLocal的set方法 public void set(T value) { Thread t = T ...