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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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 CAD
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
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to Template
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education