Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me write this Java class function. We are using the latest version of java. Thank You! Please provide screenshots of your code and
Please help me write this Java class function. We are using the latest version of java. Thank You! Please provide screenshots of your code and output since it is easier to see the format that way.
public class BankDemo
{ public static void main(String[] args) { Bank csumbBank = new Bank("CSUMB"); System.out.println(" ========== Three New Accounts =========="); csumbBank.openAccount("Tom Smith", "123 University Center 93955", 77777, 1000, 1, 10.0); csumbBank.openAccount("Alice Smith", "123 University Center 93955", 88888, 2000, 1, 50.25); csumbBank.openAccount("Joe Otter", "2440 Ocean Avenue 93900", 99999, 3000, 2, 100.25); System.out.println(" ========== Bank Info =========="); csumbBank.bankInfo(); System.out.println(" ========== Close Account =========="); System.out.println(csumbBank.closeAccount(1000)); System.out.println(csumbBank.closeAccount(7000)); System.out.println("========== Account Info =========="); csumbBank.accountInfo(2000); System.out.println(csumbBank.accountInfo(7000)); } }Develop three classes called Bank, Account, and Customer to store account information and its customer information for a bank Bank Class an name: String - accounts: Account ] If necessary, add more instance variables. Bank (String) + openAccount (name: String, addr:String, ssn:int, accNum:int, accType:int, balance:double): boolean + closeAccount(accNum:int): boolean + update Address (accNum:int, addr:String): boolean + bankInfo): voiod If necessary, add more met hods Your Bank class can have a maximum of five accounts. For the openAccount() method, your class should add a new account with the account number, accNum, and the corresponding infor- mation. Additionally, your method should put the customer information with the SSN number in the account object. If the account number is already taken by another object or maximum accounts (- five) are already used in the bank, your method should return false. Furthermore, if a cus- tomer with the SSN already has an account in the bank, your method should return false as well. For the closeAccount) method, your class should delete the account with the account number, accNum, from the bank. If the account number doesn't exist in the bank, your method should return false. For the accountInfo() method, your class should display the account information with the cor- responding customer information. If the account number doesn't exist in the bank, your method should return false. For the updateBalance() method, your class should change the balance with the new amount for the account number. If the account number doesn't exist in the bank or the balance is a negative number, your method should return false For the updateAddress () method, your class should update the address of the customer with the account number. If the account number doesn't exist in the bank, vour method should return false Develop three classes called Bank, Account, and Customer to store account information and its customer information for a bank Bank Class an name: String - accounts: Account ] If necessary, add more instance variables. Bank (String) + openAccount (name: String, addr:String, ssn:int, accNum:int, accType:int, balance:double): boolean + closeAccount(accNum:int): boolean + update Address (accNum:int, addr:String): boolean + bankInfo): voiod If necessary, add more met hods Your Bank class can have a maximum of five accounts. For the openAccount() method, your class should add a new account with the account number, accNum, and the corresponding infor- mation. Additionally, your method should put the customer information with the SSN number in the account object. If the account number is already taken by another object or maximum accounts (- five) are already used in the bank, your method should return false. Furthermore, if a cus- tomer with the SSN already has an account in the bank, your method should return false as well. For the closeAccount) method, your class should delete the account with the account number, accNum, from the bank. If the account number doesn't exist in the bank, your method should return false. For the accountInfo() method, your class should display the account information with the cor- responding customer information. If the account number doesn't exist in the bank, your method should return false. For the updateBalance() method, your class should change the balance with the new amount for the account number. If the account number doesn't exist in the bank or the balance is a negative number, your method should return false For the updateAddress () method, your class should update the address of the customer with the account number. If the account number doesn't exist in the bank, vour method should return false
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started