国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

銀行取款機(jī)Cash 系統(tǒng)源程序

2019-11-18 13:26:20
字體:
供稿:網(wǎng)友

  這是一個(gè)關(guān)于銀行取款機(jī)的程序,覺得知識(shí)有限,請(qǐng)高手們幫我改改,讓我的程序更加的完善!!謝謝各位!!!!!
  
  
   // Cash.java
   // A Miniproject in Bank System
  
   //import extension packages
   import javax.swing.*;
  
   public class Cash
   {
   public static void main( String args[] )
   {
   /* Initializer list specifies number of element and
   value for each element */
   int passWord[] = { 1111,2222,3333,4444,5555,6666 };
   int supe; // int first value
   int cash = 8888; // number of money
   int money = 0; // int third value
   int i = 1; // number of i
  
   // A do/while loop
   do
   {
   // String a value and read in password from user
   String supesum =
   JOptionPane.showInputDialog( "Welcome to use this Cash Systerm!/n"+
   "Now please Enter your password :" );
  
   // convert numbers from type String to type int
   supe = Integer.parseInt( supesum );
  
   // A if/else control strUCter
   if ( supe==password[0]
   supe==password[1]
   supe==password[2]
   supe==password[3]
   supe==password[4]
   supe==password[5] )
  
   break;
  
   else
   JOptionPane.showMessageDialog(null,"You put in the password is Wrong!/n"+
   "Please try again" );
  
   }
   while( i>0 );
  
   //show the option table for user to choose
   //set a loop to see whether the choise is 1, 2 or 3
  
   int choise; // int a vlaue
  
   while( i==1 )
   {
  
   do
   {
   // String a value and read in choise from user
   String inputChoise =
   JOptionPane.showInputDialog ( "/tEnter your choise :/n" +
   "/t/t 1 Check your Cash-card'cash/n" +
   "/t/t 2 Pick out your cash/n" +
   "/t/t 3 Put in your cash/n" +
   "/t/t 4 EXIT" );
  
   // convert number from type string to type int
   choise = Integer.parseInt( inputChoise );
  
   switch( choise )
   {
   case 1 :
   JOptionPane.showMessageDialog( null,"Your Cash-Card have got " + cash );
   break;
  
   case 2 :
   // String a value and read in money from user
   String out =
   JOptionPane.showInputDialog( "How much do you want to pick out ?/n"+
   "Please input the cash number in the blank dialog!" );
   money = Integer.parseInt( out );
   cash = cash - money;
   break;
  
   case 3 :
   // String a value and read in money from user
   String in =
   JOptionPane.showInputDialog( "How much do you want to put in ?/n"+
   "Please input the cash number in the blank dialog!" );
   money = Integer.parseInt( in );
   cash = cash + money;
   break;
  
   case 4 :
   JOptionPane.showMessageDialog( null, "Thank you for use this Cash Systerm!" );
  
   System.exit(0);
   }
  
   }
   while( choise<1 choise>4 );
  
   } //end the loop
  
   System.exit(0);
  
   } // end method close
  
   } // end class Bank

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 南阳市| 霍林郭勒市| 崇左市| 扎囊县| 都江堰市| 荥阳市| 淮滨县| 九龙坡区| 宁城县| 松江区| 浑源县| 汶上县| 璧山县| 汶川县| 双鸭山市| 理塘县| 金昌市| 义乌市| 普兰店市| 监利县| 新郑市| 五莲县| 左云县| 禹州市| 永春县| 定远县| 平阴县| 罗田县| 齐齐哈尔市| 清镇市| 嘉善县| 疏勒县| 仁化县| 大安市| 广水市| 潜山县| 临猗县| 大邑县| 海门市| 开鲁县| 民权县|