For conversion rates and currency amounts, any special characters such as dollar signs are removed prior to processing. The only caveat is that they are case-sensitive, so john and John are different users. For usernames, there is no restriction on the format. quit exits the program.įor currencies, only three letter currency ISO Codes can be entered. withdraw is used to withdraw from a user's account. deposit is used to deposit into a user's account. MAINT is used to enter in currency conversion data to USD. Once the application has started, type help to see a list of commands. You may get an error with the javac command on Windows, in which case you need to set the path variable using set path=%path% C:\Program Files\Java\jdk1.8.0_131\bin or wherever you have the JDK installed. Run javac Main.java FinCalc.java Account.java CurrencyPair.java and then run java Main. Then open up your command line prompt and cd into that downloaded folder on your computer. Otherwise, if you have JDK installed, you should download the src folder from the repository. The easiest way to run this program is to clone this repository to your favorite Java IDE, such as IntelliJ IDEA, and run main.java. It takes currency conversion data as input from you and allows you to add or subtract amounts in foreign currencies if you have the currency conversion data of that currency to USD.
Their new balances are 40.17 USD and 6610.00 JPY respectively.įinCalc 1.0 is a financial calculator capable of adding and subtracting money from a user's account. Transferred 59.00 USD/6610.00 JPY from the account of admin to the account of john12. Withdrew 0.83 USD from the account of admin. Would you like to save this currency conversion data in the database? (y/n): yĭeposited 100.00 USD into the account of admin. Here is what a typical use of the program could look like: Currencies using spaces as thousands separators are also not supported, as there is no way to distinguish between a thousands separator and a separator of arguments. Commas are also removed, as they are assumed to be thousands separators and decimal points are assumed to be represented by a period, so any currencies using commas as decimals points or periods as thousands separators are not supported. For currencies, only three letter currency ISO Codes can be entered. Both the username and password are case sensitive and have no requirement for length. Usernames must start with a letter and cannot have special characters in them. transfer is used to transfer money from a user's own account to another account. SUB is used to withdraw from a user's own account. ADD is used to deposit into a user's own account. BAL is used to check the user's account balance. Other commands are accessible to all accounts, but the admin needs to specify the account to manipulate with an additional parameter. USERS is used to see the list of all usernames.
ADDUSER and DELUSER allow the admin to add and delete users. MAINT is used to enter in currency conversion data. Several commands are only accessible by the admin account. Once logged in, type help to see a list of commands. The credentials for the management account are admin for the username and admin for the password. Once the application has started, you will need to login. Then open up your command line prompt and cd into the src folder. FinCalc 2.0 is a financial calculator capable of allowing multiple users to add and subtract money from their own accounts, as well as transfer money to other accounts.