Requirement: In this assignment, you are going to build classes that handle bank accounts to support foreign currencies. In the attached files, there is a new class ForeignCurrencyAccount that extends the Account class that you developed in the previous assignment. Please complete the implementation of ForeignCurrencyAccount, because it only includes method headers, and TO DO comments for you to complete. You will use the Account class that you have developed earlier. Copy your version of Account.java to same src folder for Assignment #3. Add this method to Account class before you start: public double getBalanceInCAD() {return balance;} Also download Test2.java and Transaction.java to your project's src folder. Test2.java file is a test program that creates Account and ForeignCurrencyAccount objects with different currencies and makes some financial transactions on the accounts. Test2 class will display account information while doing transactions. Transaction class is used to buy / sell foreign currency. Do not change anything in Test2 class and Transaction class. Do not add new attributes or methods to ForeignCurrencyAccount class. Just implement the locations where you see // TODO: comments. You can have as many as local variables necessary within methods. Deliverables: After completing your program, test it with the given Test2.java and make sure that your program generates the same output that is shown below. Please also test it by sending various inputs to make sure that your ForeignCurrencyAccount class is working perfectly. Copy and paste your code for "ForeignCurrencyAccount" class into your submission to this assignment. Your class will be tested with this "Test2.java" and your program's output is expected to be the same as the below output. Account: 1122 my checking account Balance: 3200.0 CADAccount: 3984 my USD account Balance: 4000.0 USDAccount: 4597 my EUR account Balance: 12000.0 EURSum of all my accounts on day 1: 26360.0 CADChanging exchange rates for day 2Sum of all my accounts on day 2: 25480.0 CADBuying 100 USDSelling 50 EURAccount: 1122 my checking account Balance: 3140.0 CADAccount: 3984 my USD account Balance: 4100.0 USDAccount: 4597 my EUR account Balance: 11950.0 EURSum of all my accounts after buying / selling foreign currency: 25480.0 CAD
Requirement:
In this assignment, you are going to build classes that handle bank accounts to support foreign currencies.
In the attached files, there is a new class ForeignCurrencyAccount that extends the Account class that you developed in the previous assignment.
Please complete the implementation of ForeignCurrencyAccount, because it only includes method headers, and TO DO comments for you to complete.
You will use the Account class that you have developed earlier. Copy your version of Account.java to same src folder for Assignment #3. Add this method to Account class before you start:
public double getBalanceInCAD() {
return balance;
}
Also download Test2.java and Transaction.java to your project's src folder. Test2.java file is a test program that creates Account and ForeignCurrencyAccount objects with different currencies and makes some financial transactions on the accounts. Test2 class will display account information while doing transactions. Transaction class is used to buy / sell foreign currency.
Do not change anything in Test2 class and Transaction class.
Do not add new attributes or methods to ForeignCurrencyAccount class. Just implement the locations where you see // TODO: comments. You can have as many as local variables necessary within methods.
Deliverables:
After completing your program, test it with the given Test2.java and make sure that your program generates the same output that is shown below. Please also test it by sending various inputs to make sure that your ForeignCurrencyAccount class is working perfectly.
Copy and paste your code for "ForeignCurrencyAccount" class into your submission to this assignment.
Your class will be tested with this "Test2.java" and your program's output is expected to be the same as the below output.
Account: 3984 my USD account Balance: 4000.0 USD
Account: 4597 my EUR account Balance: 12000.0 EUR
Sum of all my accounts on day 1: 26360.0 CAD
Changing exchange rates for day 2
Sum of all my accounts on day 2: 25480.0 CAD
Buying 100 USD
Selling 50 EUR
Account: 1122 my checking account Balance: 3140.0 CAD
Account: 3984 my USD account Balance: 4100.0 USD
Account: 4597 my EUR account Balance: 11950.0 EUR
Sum of all my accounts after buying / selling foreign currency: 25480.0 CAD
Step by step
Solved in 2 steps with 1 images