This program contains code for a basic credit card provider. It can add new credit card accounts, process charges and credits against them, and displays a summarry after completion.
The design decisions I made resemble Facade Design pattern. I created three files each containing a class:
main.py: main class that runs the program, reads input and forwards the command to credit card processorcredit_card_processor.py: the Credit Card Processor, that processes the commands and manipulates user informationuser.py: records User information
Python helps me focus on the program requirements, by having me deal with lesser idiosyncracies that comes with any programming language. In my opinion, I am able to achieve more in fewer steps or lines of code than many other programming languages.
- python >=3.0
- pip
- pytest
pip install pytest
- pyinstaller
pip install pyinstaller
$ pytest
To run tests, use the above command in the root directory of this program.
$ pyinstaller --onefile main.py
This will generate the executable in a subdirectory called dist that can be used with the input files.