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 ...
随机推荐
- C语言基础(19)-结构体,联合体,枚举和typedef
一.结构体 1.1 结构体struct定义及初始化 #include <stdio.h> // 这个头文件在系统目录下 #include <stdlib.h> // 使用了sy ...
- 60. Search Insert Position 【easy】
60. Search Insert Position [easy] Given a sorted array and a target value, return the index if the t ...
- java编译器特性
1.当一个表达式两边都是字面量,则编译过程中就会进行计算,并将结果生成在表达式的位置,以节省运算效率: ps:jvm认为只有是字面量时,才会对比常量池中内容:而如果是new的新对象为不同对象. 例1: ...
- Windows下免费软件的首选推荐
PS:以下按装机顺序排列,“|”号后面是备选软件. 启动引导:EasyBCD 虚拟机:VirtualBox Linux:Zorin | Linux Mint(Mate) | Ubuntu 驱动工具:驱 ...
- Android-Dialog风格Activity开发
1.设置窗口风格 : ①在Manifest中设置主题属性android:theme="@android:style/Theme.Dialog",或者 Theme.Holo.Dial ...
- jetty端口灵活配置方法
在使用maven开发web项目极大地方便了jar包的依赖,在测试时也可以集成Servlet容器,从启动速度和量级上看,Jetty无疑是不二选择. 如果多个项目同时启动,就会端口冲突了. 一种办法是通过 ...
- 更改centos 7 的默认启动为命令界面
vi /etc/inittab 可以看到这样两行: # To set a default target, run:# systemctl set-default TARGET.target 故: su ...
- node c++ addon注意事项
The module_name needs to match the filename of the final binary (minus the .node suffix).
- Failed to load the JNI shared library jvm.dl
. 原因1:该目录下jvm.dll不存在 2 解决办法:重新安装jdk或者jre并配置好环境变量.copy一个jvm.dll放在该目录下 3 原因2:eclipse的版本与jdk或者jre版本不一致 ...
- java前端传入的json字符串保存到表中的方法
表 service_goods_base 字段如下: 传入的json 字符串: servicePictureArray : [{"picServiceUrl": "h ...