Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Java CheckingBankAccount- A checking bank account has value, a person can wit

ID: 3796714 • Letter: I

Question

In Java

CheckingBankAccount- A checking bank account has value, a person can withdraw, deposit money to the account Address - This is a simple class which has all String fields to represent an address (ex. Address line 1, Iine2, City, State, Zip) Person - A person has a first and last name, address and has a CheckingBankAccount Bank - Bank is "associated" with the checking account. Bank has a String name and address. You do not need to have a CheckingBankAccount object within this class. However it is up to you to design/model this representation.

Explanation / Answer

Here is the code for the above scenario

CheckingBankAccount

package demo;

public class CheckingBankAccount {
   int accountValue;

   public int getAccountValue() {
       return accountValue;
   }

   public void setAccountValue(int accountValue) {
       this.accountValue = accountValue;
   }
  
}

Address

package demo;

public class Address {
   String addLine1;
   String addLine2;
   String City;
   String State;
   String Zip;
   public String getAddLine1() {
       return addLine1;
   }
   public void setAddLine1(String addLine1) {
       this.addLine1 = addLine1;
   }
   public String getAddLine2() {
       return addLine2;
   }
   public void setAddLine2(String addLine2) {
       this.addLine2 = addLine2;
   }
   public String getCity() {
       return City;
   }
   public void setCity(String city) {
       City = city;
   }
   public String getState() {
       return State;
   }
   public void setState(String state) {
       State = state;
   }
   public String getZip() {
       return Zip;
   }
   public void setZip(String zip) {
       Zip = zip;
   }
}

Person

package demo;

public class Person {
   String firstName;
   String lastName;
   Address Address;
   CheckingBankAccount account;
   public String getFirstName() {
       return firstName;
   }
   public void setFirstName(String firstName) {
       this.firstName = firstName;
   }
   public String getLastName() {
       return lastName;
   }
   public void setLastName(String lastName) {
       this.lastName = lastName;
   }
   public Address getAddress() {
       return Address;
   }
   public void setAddress(Address address) {
       Address = address;
   }
   public CheckingBankAccount getAccount() {
       return account;
   }
   public void setAccount(CheckingBankAccount account) {
       this.account = account;
   }   
}

Bank

package demo;

public class Bank {
   String name;
   String address;
   public String getName() {
       return name;
   }
   public void setName(String name) {
       this.name = name;
   }
   public String getAddress() {
       return address;
   }
   public void setAddress(String address) {
       this.address = address;
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote