Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Constructors All constructors should be defined as public. A default constructor should be included. The default balance is set to zero and the account number

image text in transcribed
Constructors All constructors should be defined as "public". A default constructor should be included. The default balance is set to zero and the account number is automatically generated based on the value of the counter A constructor should be included that receives a single double value as a parameter. The parameter will provide the initial balance for the account. Account number will be automatically generated Public Methods getAcetNe - This is a "get" method used to retrieve the account number getBalance - This is a "get" method used to retrieve the account balance. getCounter - this is a "get" method used to retrieve the number of accounts created, which also serves as the counter for automatically generating the account number setBalance - This is a "set" method used to set the account balance. Since the account number and counter should not be modified manually, so there should be no set method for those two variables. deposit. This method should receive a double value as a parameter. The parameter indicates how much will be deposited into the account. The amount should be positive (otherwise it doesn't do anything and the program should print a message). The account balance should be updated accordingly. charge - This method should receive a double value as parameter. The parameter indicates how much will be charged to the account and the balance should be decreased accordingly. The charge amount should be positive (otherwise it doesn't do anything and the program should print a message). The new balance is allowed to be negative. transferin - this method allows transferring money from another Student Account. There are two parameters, an object of Student Account and the amount to be transferred in. The amount should be positive (otherwise it doesn't do anything). The balance of both accounts should be updated accordingly. The new balance is allowed to be negative. transfer Out - this method allows a transfer from the current account to another Student Account. There are two parameters, an object of the other Student Account and the amount to be transferred out. The amount should be positive (otherwise it doesn't do anything). The balance of both accounts should be updated accordingly. The new balance is allowed to be negative. printinfo -- this method takes no parameter. It displays the account information in the following format: Account number Current balance: Constructors All constructors should be defined as "public". A default constructor should be included. The default balance is set to zero and the account number is automatically generated based on the value of the counter A constructor should be included that receives a single double value as a parameter. The parameter will provide the initial balance for the account. Account number will be automatically generated Public Methods getAcetNe - This is a "get" method used to retrieve the account number getBalance - This is a "get" method used to retrieve the account balance. getCounter - this is a "get" method used to retrieve the number of accounts created, which also serves as the counter for automatically generating the account number setBalance - This is a "set" method used to set the account balance. Since the account number and counter should not be modified manually, so there should be no set method for those two variables. deposit. This method should receive a double value as a parameter. The parameter indicates how much will be deposited into the account. The amount should be positive (otherwise it doesn't do anything and the program should print a message). The account balance should be updated accordingly. charge - This method should receive a double value as parameter. The parameter indicates how much will be charged to the account and the balance should be decreased accordingly. The charge amount should be positive (otherwise it doesn't do anything and the program should print a message). The new balance is allowed to be negative. transferin - this method allows transferring money from another Student Account. There are two parameters, an object of Student Account and the amount to be transferred in. The amount should be positive (otherwise it doesn't do anything). The balance of both accounts should be updated accordingly. The new balance is allowed to be negative. transfer Out - this method allows a transfer from the current account to another Student Account. There are two parameters, an object of the other Student Account and the amount to be transferred out. The amount should be positive (otherwise it doesn't do anything). The balance of both accounts should be updated accordingly. The new balance is allowed to be negative. printinfo -- this method takes no parameter. It displays the account information in the following format: Account number Current balance

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

Step: 3

blur-text-image

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

CL I P COL Astro- L(1-cas0) Lsing *A=2 L sin(0/2)

Answered: 1 week ago