Designing an exchange rate conversion program using python OOP
OOP design mode, create exchange rate conversion, set the exchange rate, set the exchange rate currency, update the exchange rate data, and display the history of the meeting
-
Download file
-
main.py
-
-
install python packget
pip install wgetpip install wget
Run main.py to enter the exchange rate conversion menu, enter 1~6 to use the functions
Enter 1 to start the exchange
Enter 2, set your own exchange currency
Enter 3 to set the displayed exchange rate
Enter 4 to delete the displayed exchange rate
Enter 5 and update the exchange rate
Enter 6 to display the exchange history
-
Variables
-
Exchange Rate Information(_Currency = [])
-
My Exchange Rate(MyCurrency = 'NTD')
-
Displayed exchange rates(MyShowCurrency = ['USD', 'HKD', 'MYR', 'CNY'])
-
Historical Exchange Rates(MyhistoryCurrency = [])
-
File Name(files = '[email protected]')
-
Now Time(nowDate = datetime.now())
-
-
Functions
-
Set up exchange rate information(makeCurrency)
-
Set the output string length(makeString)
-
Exchange rate conversion(getExchangeRate)
-
-
User Information(User)—Included functions
-
All available exchange rates(getAvailableCurrency)
-
My Exchange Rate(getMyCurrency)
-
All new display rates available(getCurrency)
-
Set my exchange rate(setMyCurrency)
-
New Display Rate(setShowCurrency)
-
Delete Show Rate(setDeleteShowCurrency)
-
-
Historical Record(history)—Included functions
-
New Historical Records(historyCurrency)
-
Historical Records(gethistoryCurrency)
-
Manual update of data(updateCurrency)
-