简单模拟一下科目三的灯光考试
来源:互联网 发布:mysql命令行导入数据库 编辑:程序博客网 时间:2024/04/30 08:43
因为毕业的事,少学习了两周的时间,唉,本来想着今天把科目三都写完的,可是明天还有事情,就先写了一下灯光的模拟,后面的以后补上,好了,老规矩,上代码:
package cn.edu.sjzc.fanyafeng.testlamejni.test;import java.util.Scanner;import cn.edu.sjzc.fanyafeng.testlamejni.util.S;/** * Created by 亚风 on 2015/06/26/0026. */public class TestThreeSubjects { public static void main(String[] args) { S.pl("科目三模拟"); testLights(); } /** * 简单列举了三个灯光测试 * 1.雾天行驶 * 2.发生故障难以移动 * 3.会车 */ private static void testLights() { S.pl("下面是灯光考试,请根据提示信息在五秒内做出相应操作!"); S.pl("请输入第一个灯光考试"); //第一个灯光考试 S.pl("请打开远光灯!"); Scanner input_light_01 = new Scanner(System.in); int light_01 = input_light_01.nextInt(); switch (light_01) { case 1: S.pl("雾天行驶,请做出相应的灯光操作!"); long start_01_time = System.currentTimeMillis(); Scanner input_light_1_1 = new Scanner(System.in); int light_1_1 = input_light_1_1.nextInt(); long end_01_time = System.currentTimeMillis(); if (light_1_1 == 1 && end_01_time - start_01_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; case 2: S.pl("发生故障难以移动,请做出相应的灯光操作!"); long start_01_2_time = System.currentTimeMillis(); Scanner input_light_1_2 = new Scanner(System.in); int light_1_2 = input_light_1_2.nextInt(); long end_01_2_time = System.currentTimeMillis(); if (light_1_2 == 2 && end_01_2_time - start_01_2_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; case 3: S.pl("会车,请做出相应的灯光操作!"); long start_01_3_time = System.currentTimeMillis(); Scanner input_light_1_3 = new Scanner(System.in); int light_1_3 = input_light_1_3.nextInt(); long end_03_3_time = System.currentTimeMillis(); if (light_1_3 == 3 && end_03_3_time - start_01_3_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; } S.pl("请打开远光灯!"); //第二个灯光考试 Scanner input_light_02 = new Scanner(System.in); int light_02 = input_light_02.nextInt(); switch (light_02) { case 1: S.pl("雾天行驶,请做出相应的灯光操作!"); long start_02_time = System.currentTimeMillis(); Scanner input_light_2_1 = new Scanner(System.in); int light_2_1 = input_light_2_1.nextInt(); long end_02_time = System.currentTimeMillis(); if (light_2_1 == 1 && end_02_time - start_02_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; case 2: S.pl("发生故障难以移动,请做出相应的灯光操作!"); long start_02_2_time = System.currentTimeMillis(); Scanner input_light_2_2 = new Scanner(System.in); int light_2_2 = input_light_2_2.nextInt(); long end_02_2_time = System.currentTimeMillis(); if (light_2_2 == 1 && end_02_2_time - start_02_2_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; case 3: S.pl("会车,请做出相应的灯光操作!"); long start_02_3_time = System.currentTimeMillis(); Scanner input_light_2_3 = new Scanner(System.in); int light_2_3 = input_light_2_3.nextInt(); long end_02_3_time = System.currentTimeMillis(); if (light_2_3 == 1 && end_02_3_time - start_02_3_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; } //第三个灯光考试 S.pl("请打开远光灯!"); Scanner input_light_03 = new Scanner(System.in); int light_03 = input_light_03.nextInt(); switch (light_03) { case 1: S.pl("雾天行驶,请做出相应的灯光操作!"); long start_03_time = System.currentTimeMillis(); Scanner input_light_3_1 = new Scanner(System.in); int light_3_1 = input_light_3_1.nextInt(); long end_03_time = System.currentTimeMillis(); if (light_3_1 == 1 && end_03_time - start_03_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; case 2: S.pl("发生故障难以移动,请做出相应的灯光操作!"); long start_03_2_time = System.currentTimeMillis(); Scanner input_light_3_2 = new Scanner(System.in); int light_3_2 = input_light_3_2.nextInt(); long end_03_2_time = System.currentTimeMillis(); if (light_3_2 == 2 && end_03_2_time - start_03_2_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; case 3: S.pl("会车,请做出相应的灯光操作!"); long start_03_3_time = System.currentTimeMillis(); Scanner input_light_3_3 = new Scanner(System.in); int light_3_3 = input_light_3_3.nextInt(); long end_03_3_time = System.currentTimeMillis(); if (light_3_3 == 3 && end_03_3_time - start_03_3_time < 50000) { S.pl("操作完成"); } else { S.pl("考试不合格"); System.exit(0); } break; } S.pl("灯光考试结束,请关闭灯光"); }// private static void testStart() {//// }}那个五秒钟本来想用线程的,可是想了想不行,不过现在感觉那个五秒还是有问题,下次修改,上一下测试的图片
0 0
- 简单模拟一下科目三的灯光考试
- 科目三中模拟灯光使用考试常见的错误 广州学车网光大国际驾校学车
- 海淀驾校告诉您:科目三模拟灯光使用考试技巧
- 简单总结一下科目三的重点
- 科目三考试通过
- 科目三考试
- 科目三考试
- 科目三外路考试
- 谈科目三考试
- 科目三考试
- 科目三考试注意事项
- 科目三及广汕路科目三考试
- MCSE2003的考试科目
- 科目三考试报告台词:
- 场外科目三考试技巧
- 科目三考试过程详解
- c1科目三考试技巧
- 关于应对科目三考试
- Shuffle'm Up
- Java中4大基本加密算法解析
- Java反射(四)利用反射调用方法
- STM32--GPIO学习
- Linux和Windows下控制台字体颜色设置
- 简单模拟一下科目三的灯光考试
- 【POJ 2253】Frogger
- 跨浏览器的placehold
- java 基础----抽象类与接口的区别,知道区别才能准备的应用
- IOS--OC--LessonNSArray 数组
- [Java]学习笔记,随笔【三】
- 企业应用架构学习笔记
- HDU 1465
- Android开发之SD卡上文件操作