Python development Program: atm+ Shopping Mall

Source: Internet
Author: User

First, the demand

1. Analog implementation of an ATM + shopping mall Program

1). realization function

1. Quota 15000 or Custom

2. Implement the shopping mall, buy things into the shopping cart, call the credit card interface checkout

3. Can withdraw cash, handling fee 5%

4. Monthly billing 22nd, 10th monthly repayment day, overdue, according to the total amount owed 5 daily interest

5. Support Multi-Account login

6. Support transfer between accounts

7. Record monthly daily consumption flow

8. Provide repayment interface

9.ATM Logging of Operation logs

10. Provide management interface, including adding account, user quota, freezing account, etc...

11. Decorator for user authentication

Second, the program code

Program Description:

# # ATM Credit Card Shopping Simulator # # Author Introduction: * author:lzl### Blog Address: * http://www.cnblogs.com/lianzhilei/p/5770672.html*/HTTP Www.cnblogs.com/lianzhilei/p/5786223.html (Program complete Flowchart) # # # Features: analog implementation of an ATM + shopping mall program Quota 15000 or custom implementation shopping mall, buy things to add shopping cart, Call the credit card interface checkout can be withdrawn, handling fee 5% support multi-account login support account transfer record monthly daily consumption flow provides payment interface ATM logging operation log provides management interface, including adding accounts, user quotas, freezing accounts, etc...   User Authentication Decorator # # # directory structure: Day4├──credit_card-shopping├──readme.md├──core #入口程序目录 │            ├──__init__.py│└──main.py #入口程序 (startup program) ├──conf #配置文件目录 │├──__init__.py │└──setting.py├──modules #程序核心目录 │├──__init__.py│├──admincenter.py #管 Module │├──authentication.py #认证模块 │├──creditcard.py #信用卡模块 │├──shopping.py # Shopping module ├──database #程序数据库 │├──creditcard_dict #信用卡数据库 │├──creditcard_record #信用卡        │├──details_tip #提示信息 │├──product_list #商城产品数据库 of water logging database    │└──shopping_car #购物车数据库 │├──shopping_record #购物记录 │└──users_dict #用户数据库 └──log├──__init__.py└──log #待扩展 .... # # # Run Description: * User, credit card information database has been established------users: Zhan Gsan Password: 123 # #测试用户, all the user links have been tested, there are shopping information, consumer records and other------users: Zhaosi password: 123 # #初始账号, no record------User: W Angwu Password: 123 # #初始账号, no record------credit card: 888888 password: 123 # #测试信用卡, all the credit card links have been tested, there is a change in the balance, bills flow and so on------ Credit card: 666666 password: 123 # #初始信用卡账号, no record------Admin Center User: admin Password: admin * directory structure consistent, start to start mian.py one, main program Credit_card -shopping start 1, load the Admincenter,shopping,authentication,creditcard directory into the System 2, enter the shopping simulator, select the corresponding mode 3, the Cycle menu (1), enter 1, load authe Ntication.user_auth () for System account authentication, then call module shopping, enter the mall shopping (2), enter 2, load Authentication.creditcard_auth () for credit card authentication, After authentication, call the CreditCard module, credit card operation (3), input 3, load Authentication.admincenter_auth () for credit card authentication, authentication through call Admincenter module, management operation (4), input Q , program termination, exit program 4, Menu 1:shopping Mall (1), load User_auth () function for user authentication, the user authentication through the shopping center (2), enter a value of 1, load shopping. Shopping_mall () function, for the purchase of goods, the purchase of goods will be added to the shopping cart, end shopping Press B to return (3), enter a value of 2, load shopping.       Shopping_car () function, view the current user's shopping cart database database, before the shopping mall selected items, will be shown here, if not shopping, will be shown as empty, and when the shopping settlement is completed, the shopping cart will be emptied, the product records to the consumption record, press B to return, press F to empty (4), input value is 3, load shopping.              Pay_shopping (current_user) function, ask whether you want to checkout, shopping cart products to purchase, select the billing operation, the system will load the account is bound to the credit card, if not bound, will be prompted to the personal center binding to settle; If you bind, load Auth_creditcard (creditcard) function for credit card password authentication, authentication successfully loaded Shoppingcar_record (current_user,list), Creditcard_rec Ord (CreditCard, value), Empty_shopping_car () functions for credit card flow, user consumption of running water, shopping cart emptying operation (5), input value of 4, enter Personal Center settings, enter the Cycle menu: ①, input 1, load Shopping. Catcar_record (current_user) function, for the current user's shopping history view, no shopping is empty, shopping records with time to split the display, press B to return to ②, enter 2, load shopping.              Updata_password (current_user) function, choose whether to change the password, enter Y, enter the original password of the account, match the success, enter a new password, enter a new password again, two times the password match succeeds, the modification succeeds, otherwise the modification fails; press B to return ③, enter 3, load shopping.        Updata_address (current_user) function, select whether to modify the delivery address, enter Y, enter a new address, save          The default address is none, press B to return ④, enter 4, and load the shopping.              Link_creditcard (current_user) function, choose whether to make a credit card binding, default is to bind; Select Y, enter the credit card number, load the credit card database to match, or fail if the credit card has a binding success, press B to return ⑤, input B, return to the previous level (6), enter a value of B, return to the previous Level menu 5, Menu 2: Credit Card Center (1), load Creditcard_auth () function for credit card authentication, certification through the credit Card Center (2), enter the value For 1, load CreditCard. My_creditcard (Current_creditcard) function, view current credit card number, quota, withdrawal amount, cardholder, press B to return (3), enter a value of 2, load CreditCard. Cash_advance (Current_creditcard) function, cash withdrawal, display card number, amount, the amount can be withdrawn, there is a specific calculation method, the amount of the withdrawal can not be greater than the amount to be withdrawn, or not greater than the amount of money; withdrawal is successful, press B to return; Call the Creditcard_record (Current_creditcard, record) function, make a credit card running record (4), enter a value of 3, load the CreditCard. Transfer (current_creditcard) function, enter the transfer option, choose to determine the transfer, enter the account number of the transfer, re-enter the transfer account, two times the same; Enter the transfer amount, not greater than the current quota, all pass, the transfer is successful; then call CREDITCA Rd_record (Current_creditcard, record) function for running records, otherwise prompt transfer fails, press B to return (5), enter a value of 4, load CreditCard. Repayment (Current_creditcard)) function, to repay the current credit card, enter the correct amount of money, repayment success, call Creditcard_record (Current_creditcard, record) to do     Water record, otherwise the repayment fails, press B to return  (6), input value is 5, load CreditCard. Catcard_record (current_creditcard) function, print the current credit card account journal date, enter the date of the date to view all the running water records (in chronological order), otherwise the print fails, re-enter, press B to return; No transaction card number is empty (7), enter a value of B, return to the previous Level menu 6, Menu 3: Central Administration (1), load Admincenter_auth () function for management certification, after certification through the Management Center, display the Management menu (2), enter a value of 1, load Admincenter. User_create () function, print the current account, start the System account creation, ask whether the process of new user creation; Select y, start creating user input to create the user name, enter the password, if the created user does not exist, the new user is created successfully; otherwise, the user name entered cannot be Blank, press B to return, print the current user list (3), enter a value of 2, and load Admincenter. Lock_user () function, print the current user list, as well as the current lock status, enter the user name to be locked, the existing account to lock, the input account does not exist, the lock failed, the input account exists, but is currently locked, the lock failed, the account exists, not locked, the display lock is successful; Prints the lock status of all current users, locks the highlight, and the locked user cannot log on to the system. Press B to return (4), enter a value of 3, and load Admincenter. Unlock_user () function, print the current user list, as well as the current lock status, enter the user name to unlock, unlock the existing account, enter the account does not exist, unlock failed, the input account exists, but is not currently locked, unlock failed, the account exists, previously locked, display unlocked Success; Print the current lock status of all users, lock highlighting, the locked user is not able to log on the system. Press B to return (5), enter a value of 4, and load Admincenter. Creditcard_create () function, print the current existing credit card, start the System credit card issue, ask whether the process credit card creation; Select Y, start issuing credit card Enter the credit card number you want to create, enter the password, and if the credit card you created does not exist, the new credit card issue is successful; Failure, anotherThe credit card entered must be a 6-digit number, not coincident, the issued credit card cannot be sent here; Press B to return, print the current latest credit card list (6), enter a value of 5, load Admincenter. Lock_creditcard ()) function, print the current credit card list, as well as the current frozen status, enter the credit card number to be frozen, the credit card number that has been frozen for the existing credit card does not exist, the freeze fails, the credit card number entered is present, but it has been frozen, the freeze has failed; Number exists, is not frozen, the display freezes successfully, the frozen status of all the current credit card numbers is printed, the blocked card number is highlighted, the blocked user cannot make a credit card login, and cannot make purchases. Press B to return (7), enter a value of 6, and load Admincenter. Unlock_creditcard ()) function, print the current credit card list, as well as the current frozen status, enter the credit card number to be unfrozen, the credit card number that has been thawed for the existing credit card does not exist, the thaw fails, the credit card number entered is present, but the current is not frozen, the thaw fails; Account exists, has been frozen, display thaw success, printing all the current credit card number of the frozen state, the frozen card number highlighted, the frozen user can not be a credit card login, can not make shopping consumption. Press B to return (8), enter a value of 7, and load Admincenter. Updata_limit () function, print the current credit card account number, the current amount available, withdraw the quota, choose whether to adjust the quota, select Y, make the quota adjustment, enter the credit card numbers to adjust the amount, 6 is the number, if the credit card entered does not exist, prompt error;         Number, enter a new amount (more than 5000), display the quota adjustment success, then print the latest credit card account number, the current amount available, withdraw the quota list; press B to return (9), enter a value of B, return to the previous level menu 7 about credit card amount, withdrawal amount, you can withdraw the amount of cash: ① credit card Default withdrawal limit is 50% of the credit card amount (This system default cash withdrawal limit is 7500) ② credit card for consumption (not cash), the withdrawal amount will not change ③ credit card amount is lower than the withdrawal amount, the preferred cash amount is the current limit (cash amount = current limit *0       .95) ④ withdrawal quota only two conditions will change, one to take cash, the second is to adjust the credit card quota ⑤ per withdrawal deduction of 5% of the transaction fee summary: credit card line for a total amount of consumption, the withdrawal amount is theoretically acceptable, the current amount is the actual amount can be withdrawn (the credit card amount is lower than the withdrawal limit may be at this time the credit card limit, and the additional fees to be added, Therefore, the current quota can not be fully completed, to deduct 5% of the handling fee, at this time may be the quota of 95%)

  

Python development Program: atm+ Shopping Mall

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.