简单模拟一下科目三的灯光考试

因为毕业的事,少学习了两周的时间,唉,本来想着今天把科目三都写完的,可是明天还有事情,就先写了一下灯光的模拟,后面的以后补上,好了,老规矩,上代码:

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() { // // } } 

那个五秒钟本来想用线程的,可是想了想不行,不过现在感觉那个五秒还是有问题,下次修改,上一下测试的图片

原文链接:https://blog.csdn.net/qq_23195583/article/details/46654711?ops_request_misc=&request_id=70cb8d88127a420ea9b115ffc835f799&biz_id=&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~koosearch~default-13-46654711-null-null.268%5Ev1%5Econtrol&utm_term=%E7%A7%91%E7%9B%AE%E4%B8%89

兔子先生 西安驾培

于灯火阑珊处,于暗香离别时,未曾放弃

相关推荐

抖音矩阵平台有哪些?

  抖音矩阵平台是指一系列用于在抖音平台上进行内容创作、运营和推广的工具和系统。其中,视界引擎短视频运营获客系统作为一款全面的抖音矩阵平台,具有许多优势。 抖音矩阵平台是当今数字营销领域的热门工 ...

怎么看待直播带货的营销形式?

随着电商行业的崛起,越来越多的商家开始使用直播的方式来进行产品推广,那么直播为什么可以推广产品带货呢?直播带货的本质是什么呢?今天,就来跟大家讲解一下。直播之所以可以推广产品,引导观众购买产品是因 ...

快抖矩阵多账号管理系统官方正版

账号源从哪里来?没有那么多抖音账号?怎么赚钱?有什么价值?       首先这是一套多开可招代理的矩阵账号管理系统,第一目的是让你拿来给有很多账号的品牌机构或达人当账号辅助管理工具打理账户 ...