【正文】
帳類型然后 要求兩次輸入目標(biāo)帳戶的帳號,之后再輸入轉(zhuǎn)帳金額。 對象設(shè)計(jì) MESSAGE( ATM __ ChangePassword) 進(jìn)入更改密碼子系統(tǒng)界面提示用戶輸入原密碼,然后兩次輸入新密碼。 MESSAGE( ATM__Back ) 返回上一層界面。 MESSAGE(ATM__Quit)推出 ATM機(jī)系統(tǒng)。 二、實(shí)現(xiàn)描述: 對象名: bankCard 類名: BankCard 私有數(shù)據(jù)結(jié)構(gòu): Integer: amount。 printf(“input the amount of money you want!”)。 三、算法設(shè)計(jì)、 取款操作算法描述( withdrawing()) 一級抽象描述 Withdarw the money you want。 二級抽象描述 Input the amount of money you want Compare it with your balance IF you balance is enough THEN DO withdraw money ELSE show message for no enough balance to withdraw 三級抽象描述 Scanf(“%d”,amp。amount)。 If (amount balance) balance = balance – amount。 else printf(“No enough money to withdraw!”)。 查詢操作算法描述( checkAccount()) 一級抽象描述 Check account 。 二級抽象描述 Choose the type of account you want to check, Then get you account balance information。 三級抽象描述 If ( press RMBAccountButton) Display your RMBAccount information If (press DollarAccountButtuon) Display your RMBAccount information If ( press HKaccountButton) Display your HKaccount information If (press otherAccountButtuon) Display your otherAccount information 轉(zhuǎn)帳操作算法描述( divertBalance()) 一級抽象描述 Transfer money among accounts 。 二級抽象描述 Input the account number you want to transfer Input the same account number again Input the amount of money you want to transfer If (the money you input is more than you balance) Minus you balance Show message (“ transferring successfully”)。 Else Show error message。 三級抽象描述 Integer: transferNum1。 Integer: transferNum2 Integer: transferAmount。 Integer: time = 0。 Printf(“input the account number you want to transfer:” ) Scanf(“%d”, amp。 transferNum1)。 time++。 Printf(“Input the same account number again:” ) Scanf(“%d”, amp。 transferNum2)。 time++。 While (transferNum1 ! = transferNum2) { If (transferNum1 ! = transferNum2) { Printf(“Input again