当前位置: 首页 > news >正文

网站备案申请流程漳州网站建设点击博大选

网站备案申请流程,漳州网站建设点击博大选,软件开发平均工资,山东建设公司网站目录 任务要求 具体实现 Parking_Management_System类 Account类 Administrators类 User类 Tool类 任务要求 本代码用于实现一个简单的停车场管理系统#xff0c;包含数据结构中的栈和队列 栈代表停车场停车的数量#xff0c;先进后出#xff0c;因为入口被视为一次只能过… 目录 任务要求 具体实现  Parking_Management_System类 Account类 Administrators类  User类 Tool类 任务要求 本代码用于实现一个简单的停车场管理系统包含数据结构中的栈和队列 栈代表停车场停车的数量先进后出因为入口被视为一次只能过一辆车 其次临时栈如果有车要出停车场则需要将其他车假设移出停车场放到临时栈中之后等待车出停车场后再使车辆依次归位停车场 队列代表临时便道如果停车场满但依然有车希望进入则进入临时便道等待直到有车出停车场 具体如下图 具体实现  本代码分为五个部分 Parking_Management_System类 用于实现主菜单功能 1.进入管理员系统 2.进入用户系统 3.退出系统 import java.util.*; public class Parking_Management_System {static Scanner scnew Scanner(System.in);static int Capacity5;static QueueStringLanenew ArrayDequeString();static StackStringParking_Spacenew StackString();public static void main(String[] args) {Scanner scnew Scanner(System.in);System.out.println(**********************);System.out.println(欢迎使用停车场管理系统);System.out.println(**********************);System.out.println(请选择需要进行的操作\管理员系统\或\用户系统\或\关于我们\或\退出系统\);while(sc.hasNext()) {String Choosesc.next();//输入进行选择boolean exitfalse;//初始化退出状态switch (Choose) {case 管理员系统: {Administrators.Administrators_System();break;}case 用户系统: {User.User_System();break;}case 关于我们: {Tool.Acknowledgement();break;}case 退出系统: {System.out.println(请选择需要进行的操作\确定\或\取消\);exitTool.Exit();//调用退出函数if(exit){System.out.println(系统已经成功关闭);System.out.println(欢迎下次使用);System.out.println();break;}}}if(exit)//退出系统{break;}System.out.println(请选择需要进行的操作\管理员系统\或\用户系统\或\关于我们\或\退出系统\);}} }Account类 用于定义用户注册账号所储存的数据包括VIP办理情况停车状态充值VIP时间优惠券数量密码剩余可购买优惠券数量停车车牌号入车时间 import java.util.*;public class Account {private boolean VIP_Card;//是否有vipprivate boolean Stop;//是否是停车状态private Date Time;//VIP充值时间private int Coupon;//是否有优惠券private String Password;//密码private int Coupon_Cnt;//还能买几次优惠券private String LicensePlateNumber;//车牌号private Date EntryTime;//入车时间public boolean isStop() {return Stop;}public void setStop(boolean stop) {Stop stop;}public boolean isVIP_Card() {return VIP_Card;}public void setVIP_Card(boolean VIP_Card) {this.VIP_Card VIP_Card;}public Date getTime() {return Time;}public void setTime(Date Time) {this.Time Time;}public int getCoupon() {return Coupon;}public void setCoupon(int Coupon) {this.Coupon Coupon;}public String getPassword() {return Password;}public void setPassword(String password) {Password password;}public int getCoupon_Cnt() {return Coupon_Cnt;}public void setCoupon_Cnt(int coupon_Cnt) {Coupon_Cnt coupon_Cnt;}public String getLicensePlateNumber() {return LicensePlateNumber;}public void setLicensePlateNumber(String licensePlateNumber) {LicensePlateNumber licensePlateNumber;}public Date getEntryTime() {return EntryTime;}public void setEntryTime(Date entryTime) {EntryTime entryTime;} }Administrators类  用于实现管理员功能查询停车场信息查询收入情况查询投放优惠券数查询用户信息 import java.text.*; import java.util.*;public class Administrators {static Scanner scnew Scanner(System.in);static String Income0;//总收入static String VIP_Income0;//VIP卡收入static String Other_Income0;//购买优惠券收入static MapString,Stringadministratorsnew HashMapString,String();static String Key;//注册管理员账号的密钥只有密钥正确才可注册管理员账号public static void Administrators_System(){if(administrators.isEmpty()){Initialization();//初始化}System.out.println(请选择需要进行的操作\登录\或\注册\或\返回\);while(sc.hasNext()) {String Choose sc.next();boolean Determinefalse;switch (Choose) {case 登录: {System.out.println(请输入管理员账号);String Account sc.next();System.out.println(请输入管理员密码);String Password sc.next();if (Administrators_Lon_on(Account, Password)) {System.out.println(登入成功);System.out.println();Administrators_System_Main_Menu();}else{System.out.println(账号或密码错误请重新尝试);System.out.println();}break;}case 注册: {System.out.println(请输入注册账号);String Account sc.next();System.out.println(请输入注册密码);String Password sc.next();System.out.println(请输入密钥);String Secret_key sc.next();Register(Account, Password, Secret_key);break;}case 返回:{Determinetrue;System.out.println(返回成功);System.out.println();break;}}if(Determine){break;}System.out.println(请选择需要进行的操作\登录\或\注册\或\返回\);}}public static void Initialization()//初始化管理员账号{administrators.put(,);//自行输入}public static void Register(String Account,String Password,String Secret_key){if(!Secret_key.equals(Key)){System.out.println(密钥错误);System.out.println();}else if(administrators.get(Account)!null){System.out.println(注册账号已存在);System.out.println(注册失败);System.out.println();}else{administrators.put(Account,Password);System.out.println(注册成功);System.out.println();}}public static boolean Administrators_Lon_on(String Account,String Password)//账号是否有效{SetStringsetadministrators.keySet();IteratorStringitset.iterator();//用于遍历用户账号while(it.hasNext()){String keyit.next();String valueadministrators.get(key);if(Account.equals(key)Password.equals(value)){return true;}}return false;}public static void Query_Income()//查询收入{System.out.println(当前总收入Income元);System.out.println(停车收入:(Integer.valueOf(Income)-Integer.valueOf(VIP_Income)-Integer.valueOf(Other_Income))元);System.out.println(会员收入VIP_Income元);System.out.println(其他收入Other_Income元);System.out.println();}public static void Query_Coupon()//查询已投放优惠券{int cnt0;SetStringsetUser.user.keySet();IteratorStringitset.iterator();while(it.hasNext()){String key it.next();cntUser.user.get(key).getCoupon();}System.out.println(已经有cnt张优惠券投入市场);}public static void Query_User()//查询用户信息{System.out.println(请输入需要查询用户账号);String accountsc.next();SetStringsetUser.user.keySet();IteratorStringitset.iterator();boolean Determinefalse;while(it.hasNext()){String keyit.next();if(key.equals(account)){Determinetrue;if(User.user.get(account).isStop()) {System.out.println(该账户停车车牌号User.user.get(account).getLicensePlateNumber());SimpleDateFormat sdfnew SimpleDateFormat(yyyy年MM月dd日 HH:mm:ss);String s sdf.format(User.user.get(key).getEntryTime());System.out.println(该用户的入车时间s);}else{System.out.println(该用户暂未停车);}break;}}if(!Determine){System.out.println(该用户不存在);}System.out.println();}public static void Query_Parking(){System.out.println(请选择需要进行的操作\查询停车场车辆信息\或\查询车位\或\等待车辆\或\返回\);while(sc.hasNext()) {boolean Determinefalse;String Choosesc.next();switch (Choose) {case 查询停车场车辆信息:{SetStringsetUser.user.keySet();IteratorString itset.iterator();System.out.println(用户名 车牌号 入车时间);while(it.hasNext()){String key it.next();if(User.user.get(key).isStop()) {SimpleDateFormat sdfnew SimpleDateFormat(yyyy年MM月dd日 HH:mm:ss);String s sdf.format(User.user.get(key).getEntryTime());System.out.printf(%-12s %-12s %-58s\n,key,User.user.get(key).getLicensePlateNumber(),s);}else{System.out.println(key 暂无停车 暂无停车);}}break;}case 查询车位: {System.out.println(停车场还剩下 (Parking_Management_System.Capacity - Parking_Management_System.Parking_Space.size()) 个空车位);System.out.println();break;}case 等待车辆:{System.out.println(当前需要等待排队车辆 Parking_Management_System.Lane.size() 辆);System.out.println();break;}case 返回: {Determinetrue;System.out.println(返回成功);System.out.println();break;}}if(Determine){break;}System.out.println(请选择需要进行的操作\查询车位\或\等待车辆\或\返回\);}}public static void Administrators_System_Main_Menu(){System.out.println(请选择需要进行的操作\查询停车场信息\或\查询收入\或\查询投放优惠券数\或\查询用户信息\或\返回\);boolean Determinefalse;while(sc.hasNext()){String Selectsc.next();switch (Select){case 查询收入:{Query_Income();break;}case 查询投放优惠券数:{Query_Coupon();break;}case 查询用户信息:{Query_User();break;}case 查询停车场信息:{Query_Parking();break;}case 返回:{Determinetrue;System.out.println(返回成功);System.out.println();break;}}if(Determine){break;}System.out.println(请选择需要进行的操作\查询停车场信息\或\查询收入\或\查询投放优惠券数\或\查询用户信息\或\返回\);}} } User类 实现用户功能查询停车场信息查询月卡查询优惠券停车操作出车操作 import java.text.*; import java.util.*;public class User {static Scanner scnew Scanner(System.in);static String Current_Account;static MapString,Accountusernew HashMapString,Account();public static void User_System(){System.out.println(请选择需要进行的操作\登录\或\注册\或\返回\);while(sc.hasNext()) {String Choose sc.next();boolean Determinefalse;switch (Choose) {case 登录: {System.out.println(请输入用户账号);String Account sc.next();System.out.println(请输入用户密码);String Password sc.next();if (User_Lon_on(Account, Password)) {System.out.println(登入成功);System.out.println();Current_AccountAccount;User_Main_Menu();}else{System.out.println(账号或密码错误请重新尝试);System.out.println();}break;}case 注册: {System.out.println(请输入注册账号);String Account sc.next();System.out.println(请输入注册密码);String Password sc.next();Register(Account, Password);break;}case 返回:{Determinetrue;System.out.println(返回成功);System.out.println();break;}}if(Determine){break;}System.out.println(请选择需要进行的操作\登录\或\注册\或\返回\);}}public static void Register(String Account,String Password) {SetString set user.keySet();IteratorString it set.iterator();boolean Determinefalse;while (it.hasNext()) {String key it.next();if(key.equals(Account)){Determinetrue;break;}}if (Determine) {System.out.println(注册账号已存在);System.out.println(注册失败);System.out.println();} else {Account account new Account();account.setStop(false);account.setCoupon(0);account.setPassword(Password);account.setVIP_Card(false);account.setCoupon_Cnt(5);user.put(Account, account);System.out.println(注册成功);System.out.println();}}public static Boolean User_Lon_on(String Account,String Password){SetStringsetuser.keySet();IteratorStringitset.iterator();while(it.hasNext()){String keyit.next();String valueuser.get(key).getPassword();if(Account.equals(key)Password.equals(value)){return true;}}return false;}public static void Query()//查询车位{System.out.println(请选择需要进行的操作\查询车位\或\等待车辆\或\返回\);while(sc.hasNext()) {boolean Determinefalse;String Choosesc.next();switch (Choose) {case 查询车位: {System.out.println(停车场还剩下 (Parking_Management_System.Capacity - Parking_Management_System.Parking_Space.size()) 个空车位);System.out.println();break;}case 等待车辆:{System.out.println(当前需要等待排队车辆 Parking_Management_System.Lane.size() 辆);System.out.println();break;}case 返回: {Determinetrue;System.out.println(返回成功);System.out.println();break;}}if(Determine){break;}System.out.println(请选择需要进行的操作\查询车位\或\等待车辆\或\返回\);}}public static void VIP_Card() {//查询月卡Date datenew Date(Long.valueOf(2592000000));Date Current_datenew Date();if(!user.get(Current_Account).isVIP_Card()||(Current_date.getTime()-user.get(Current_Account).getTime().getTime()date.getTime())) {System.out.println(您当前未充值月卡);System.out.println(充值月卡即可免费停车每月只需800元);System.out.println(您可以选择\充值月卡\或\返回\);System.out.println();while(sc.hasNext()) {boolean Determinefalse;String Choose sc.next();switch (Choose) {case 充值月卡: {System.out.println(是否确定充值月卡\确定\或\取消\);String Select sc.next();switch (Select) {case 确定: {System.out.println(恭喜您成功充值成为我们的VIP客户);Administrators.VIP_IncomeString.valueOf(Double.valueOf(Administrators.VIP_Income)800);Administrators.IncomeString.valueOf(Double.valueOf(Administrators.Income)800);user.get(Current_Account).setTime(Current_date);user.get(Current_Account).setVIP_Card(true);break;}case 取消: {break;}}break;}case 返回: {Determine true;System.out.println(返回成功);System.out.println();break;}}if (Determine||(user.get(Current_Account).isVIP_Card())) {break;}System.out.println(您当前未充值月卡);System.out.println(充值月卡即可免费停车每月只需800元);System.out.println(您可以选择\充值月卡\或\返回\);System.out.println();}}else{System.out.println(尊敬的VIP用户您好);SimpleDateFormat sdfnew SimpleDateFormat(dd天 HH小时mm分钟ss秒);String ssdf.format(date.getTime()-(Current_date.getTime()-user.get(Current_Account).getTime().getTime()));System.out.println(您的VIP仅剩s就到期了);}}public static void Coupon()//优惠券{System.out.println(请选择需要进行的操作\查询剩余优惠券\或\购买优惠券\或\返回\);while(sc.hasNext()){boolean Determinefalse;String Choosesc.next();switch (Choose){case 查询剩余优惠券:{System.out.println(您还有user.get(Current_Account).getCoupon()张优惠券可以使用);break;}case 购买优惠券:{System.out.println(是否确定花费50元购买7.5折优惠券\确定\或\取消\);String Selectsc.next();switch (Select) {case 确定: {System.out.println(购买成功);Administrators.Other_IncomeString.valueOf(Double.valueOf(Administrators.Other_Income)50);Administrators.IncomeString.valueOf(Double.valueOf(Administrators.Income)50);user.get(Current_Account).setCoupon(user.get(Current_Account).getCoupon()1);user.get(Current_Account).setCoupon_Cnt(user.get(Current_Account).getCoupon_Cnt()-1);System.out.println(剩余可购买次数:user.get(Current_Account).getCoupon_Cnt());System.out.println();break;}case 取消: {break;}}break;}case 返回:{Determinetrue;System.out.println(返回成功);System.out.println();break;}}if(Determine){break;}System.out.println(请选择需要进行的操作\查询剩余优惠券\或\购买优惠券\或\返回\);}}public static void Stop()//停车{if(user.get(Current_Account).isStop()){System.out.println(本账号已经记录停车车辆或正在排队停车);System.out.println(请出车后再使用);}else{System.out.println(请输入车牌号:);String LicensePlateNumber sc.next();user.get(Current_Account).setLicensePlateNumber(LicensePlateNumber);if(Parking_Management_System.Capacity-Parking_Management_System.Parking_Space.size()0) {//有空位Date date new Date();user.get(Current_Account).setEntryTime(date);Parking_Management_System.Parking_Space.push(Current_Account);user.get(Current_Account).setStop(true);System.out.println(停车成功);System.out.println();}else {//没空位进入等待车道System.out.println(停车场已满请排队);System.out.println(您当前是第Parking_Management_System.Lane.size()位置);System.out.println();user.get(Current_Account).setStop(true);Parking_Management_System.Lane.add(LicensePlateNumber);}}}public static void Departure()//出车{StackStringTemporary_AccessRoadnew StackString();int cnt0;while(!Parking_Management_System.Parking_Space.isEmpty()){Temporary_AccessRoad.push(Parking_Management_System.Parking_Space.pop());if(Temporary_AccessRoad.peek().equals(user.get(Current_Account).getLicensePlateNumber())){Temporary_AccessRoad.pop();if(!user.get(Current_Account).isVIP_Card()){Date datenew Date();Long Time(date.getTime()-user.get(Current_Account).getEntryTime().getTime())/1000/60;SimpleDateFormat sdfnew SimpleDateFormat(yyyy年MM月dd日 HH:mm:ss);String s1 sdf.format(user.get(Current_Account).getEntryTime());String ssdf.format(date);System.out.println(本次入车时间:s1);System.out.println(本次出车时间:s);System.out.println(请选择\优惠券支付\或\正常支付\);String Choosesc.next();double sum0;if(Time15){System.out.println(本次停车免费);}else {sum(Time-15)*1.5;System.out.printf(本次停车需缴纳%.2f元\n ,sum );switch (Choose){case 优惠券支付:{if(user.get(Current_Account).getCoupon()!0){user.get(Current_Account).setCoupon(user.get(Current_Account).getCoupon()-1);Administrators.IncomeString.valueOf(Double.valueOf(Administrators.Income)sum*0.75);System.out.printf(支付成功本次实际缴纳%.2f\n,0.75*sum);}else{System.out.println(您当前的优惠券数量不足);Administrators.IncomeString.valueOf(Double.valueOf(Administrators.Income)sum);System.out.printf(支付成功本次实际缴纳%.2f元\n,sum);System.out.println();}break;}case 正常支付:{Administrators.IncomeString.valueOf(Double.valueOf(Administrators.Income)sum);System.out.printf(支付成功本次实际缴纳%.2f元\n,sum);break;}}}}else{System.out.println(尊敬的VIP客户本次已为您免单);}System.out.println(出车完成);System.out.println(本次退让次数cnt);System.out.println(欢迎下次再来);user.get(Current_Account).setStop(false);System.out.println();break;}cnt;}while(!Temporary_AccessRoad.isEmpty()){Parking_Management_System.Parking_Space.push(Temporary_AccessRoad.pop());}while(Parking_Management_System.Parking_Space.size()Parking_Management_System.Capacity){if(Parking_Management_System.Lane.size()0){break;}Parking_Management_System.Parking_Space.push(Parking_Management_System.Lane.poll());}}public static void User_Main_Menu(){System.out.println(请选择需要进行的操作\查询停车场信息\或\查询月卡\或\查询优惠券\或\停车\或\出车\或\返回\);while(sc.hasNext()){boolean Determinefalse;String Selectsc.next();switch (Select){case 查询停车场信息:{Query();break;}case 查询月卡:{VIP_Card();break;}case 查询优惠券:{Coupon();break;}case 停车:{Stop();break;}case 出车:{Departure();break;}case 返回:{Determinetrue;System.out.println(返回成功);System.out.println();break;}}if(Determine){break;}System.out.println(请选择需要进行的操作\查询停车场信息\或\查询月卡\或\查询优惠券\或\停车\或\出车\或\返回\);}} }Tool类 其他功能实现 import java.util.*;public class Tool {public static void Acknowledgement(){System.out.println(本系统由进行研发);System.out.println(成员包括排名不分先后);System.out.println(感谢使用!);System.out.println();}public static boolean Exit(){Scanner scnew Scanner(System.in);String Choose sc.next();switch (Choose){case 确定: {return true;}case 取消: {return false;}}System.out.println(无效操作);return false;} }
http://www.zqtcl.cn/news/469046/

相关文章:

  • 做个企业网站 优帮云移动商城个人中心手机卡进度查询
  • 深圳建设网站哪家最好国外互联网裁员
  • 网站重新建设的请示wordpress get_terms 排序
  • 建站模板免费下载wordpress 管理地址
  • 静安企业网站制作wordpress文章列表显示缩略图
  • html前端网站开发先做网站还是先解析
  • 怎么通过域名访问网站elision wordpress
  • 做邮轮的网站做游戏的软件app
  • 做网站用php还是python家装十大品牌排行榜
  • 湛江网站建设招聘创作者服务平台
  • 衡阳建网站高中制作网站怎么做
  • 上海网站排名团队推广链接跳转
  • 寻找郑州网站优化公司上海高端网站定制
  • 网站关键词排名优化长城建设投资有限公司网站
  • 网站专题优化电子商务网站运营方案
  • 唐山建网站公司湖南网站制作电话
  • 做神马网站优化合肥城乡建设局官网
  • 网站开发与管理心得体会建设高流量网站
  • 网站安全建设的重要性减粘装置设备设计要点
  • 建设一个网站的所有代码Django和wordpress速度
  • 临沂市建设局网站公示php建站系统
  • 有哪些好的做问卷调查的网站好学的专业是编课 网站开发英语翻译
  • 个人网站免费推广广饶网站制作
  • 怎么检测网站是否安全拍卖网站开发
  • 沂源网站制作自建网站的流程
  • 网站关键词收录查询网站最好服务器
  • 做百度移动网站优网站建设类论文选题
  • 自己做的网站怎样让百度搜到长沙专业外贸建站公司
  • 上海缔客网站建设公司网站策划书内容不包括什么
  • 找团队做网站网站建设 通知