[Restructuring to Mode-Command pattern] Bank ATM service function

Source: Internet
Author: User

In addition to Balance inquiry, deposit, and money collection services, the current bank ATM can also provide various services such as water payment, electricity fee, and gas fee. Use your familiarProgramming LanguageTDD and command design modes to implement the following service functions of a bank ATM:

1) Check balance)

2) Save Money (deposit)

3) withdraw money (withdraw)

4) residential electricity card purchase (assume 2 yuan per power supply) (electric Card, RMB 2 per unit)

Test Case prompt:

1) query balance: 0 RMB

2) deposit 1000 yuan, query balance: 1000 yuan

3) retrieve 300 RMB, and check the balance: 700 RMB

4) Electricity Purchase: 100 degrees, query balance: 500 yuan, electric Card new 100 degrees electricity

------------------------------------

OriginalArticleFor more information, see the source. Thank you. Address: http://blog.csdn.net/wubinben28/article/details/9886727

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.