Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This needs to be written in Java BankAccount class -logic for addBankAccount( ) BankAccount Class data members: --> protected int accNumber; -->protected Person accHolder; -->protected

This needs to be written in Java

BankAccount class -logic for addBankAccount( )

BankAccount Class data members:

--> protected int accNumber;

-->protected Person accHolder;

-->protected double balance;

Methos addBankAccount( ):

READ valid accountNumber from user (positive integer only)

(PUT message to enter accountNumber

GET accountNumber

WHILE accountNumber is not valid

PUT error message...re-enter

GET accountNumber

ENDWHILE

)

READ firstName from user

READ lastname from user

READ phoneNumber from user

READ emailAddress from user

READ valid balance from user

Create accHolder by invoking constructor

RETURN true image text in transcribed

Class Person: This class will contain common data members for a person f lastName, phoneNumber emailAddress. rstName Methods constructor () to create accHolder object. o o Required getters Class BankAccount . This class will be the base class and for data members contain the common all Bank Accounts (ie accountNumber accHolder, balance). Here, accHolder is an object of class Person. Methods o toString):Stringreturns the data of the account formatted to display o addBankAccount): boolean prompts user to enter data for this object from keyboard edits data, and doesn't allow user to continue with bad data o updateBalance (double) - updates the balance in the object by the parameter amount monthlyAccountUpdate() processes the object with monthly update (make it abstract for base class.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions