Programming Project Modeling Bank Accounts The objectives of

Programming Project: Modeling Bank Accounts The objectives of this assignment are to: . Be able to write a Java class definition with a main method that creates and uses instances (Objects) of another class. Be able to declare Java variables that refer to a class data type, in this project the BankAccount class, and are initialized by instances of that class (by calls to the class constructor) . Be able to use the public methods, such as get and set methods of an Object to read and write values stored in that Object. Understand that the data stored in an Object can only be accessed by the public methods defined in that Object\'s class definition. This assignment is based on your use of the public methods of the BankAccount class, provided below, to modify the checking and savings accounts of two individuals: Nick and Carol. You need to copy the source code from this class into an empty window in the IDE you are using, then save it and compile it. Your job is to create a BankingDriver class and write statements in its main method that carry out the actions specified in the Project Requirements list below. Your statements must use the public methods provided by the BankAccount class. You will submit the BankingDriver.java code as your solution to this problem.

Solution

Hi, Please find my implementation.

Please let me know in case of any issue.

public class BankingDriver {

   public static void main(String[] args) {

      

       // 1

       BankAccount nicksAcct = new BankAccount(\"Nick\", 450, 550);

       //2

       BankAccount carolsAcct = new BankAccount(\"Carol\", 600, 700);

       //3

       nicksAcct.printReport();

       carolsAcct.printReport();

      

       //4

       int total = nicksAcct.getCheckMoney()+nicksAcct.getSaveMoney() +

               carolsAcct.getCheckMoney() + carolsAcct.getSaveMoney();

       System.out.println(\"Total money in all accounts: $\"+total);

      

       //5

       nicksAcct.makeCheckingDeposit(100);

      

       //6

       nicksAcct.printReport();

      

       //7

       int saving = nicksAcct.getSaveMoney();

       int checking = nicksAcct.getCheckMoney();

       nicksAcct.makeCheckingWithdrawal(checking);

       nicksAcct.makeSavingWithdrawal(saving);

       carolsAcct.makeCheckingDeposit(checking+saving);

      

       //8

       nicksAcct.printReport();

       carolsAcct.printReport();

   }

}

/*

Sample output:

Nick checking:450 saving:550

Carol checking:600 saving:700

Total money in all accounts: $2300

Nick checking:550 saving:550

Nick checking:0 saving:0

Carol checking:1700 saving:700

*/

 Programming Project: Modeling Bank Accounts The objectives of this assignment are to: . Be able to write a Java class definition with a main method that create
 Programming Project: Modeling Bank Accounts The objectives of this assignment are to: . Be able to write a Java class definition with a main method that create

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site