logotransparent.png

Legion of Learners

www.lol-101.com

  • Home

  • Classrooms

  • Courses

  • About Us

    • Executive Team
    • Board Members
  • Resources

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    sfolax6776
    Sep 25, 2021

    1-11 Lab 1: Money and BankAccount

    in AP Computer Science A

    Create two classes: Money and BankAccount.

    1. Money class should have two instance variables amount and currency, plus a static double array to store exchange rates. Assume there are 6 currencies: USD, CND, AUD, EUR, RMB and JPY. Assume the static double array always stores the latest exchange rate for USD. See code base here . Please implement public Money add(Money m) and public Money subtract(Money m) methods.

    2. BankAccount class should have the following instance variables.

      String accountNumber;
      String firstName;
      String lastName;
      private Money balance;

    Complete the BankAccount class by implementing the following:

    1. Three constructors

    2. All getters and setters

    3. public void display()

    4. public boolean withdraw(Money m)

    5. public void deposit(Money m)

    0 comments
    0
    0 comments

    Questions? Email us at legionoflearners@gmail.com or join our WeChat group!

    • lol-101dotcom

    ©2020 Legion of Learners