subject
Engineering, 10.11.2019 06:31 octavioC2

Bank account class design a bankaccount class that represents a basic bank account. the class constructor should accept the account’s number, current balance, and name of owner. the class should also have methods for subtracting the amount of a withdrawal and adding the amount of a deposit. write code to do the following: public class static constants (declare to be final): min_length = 2; max_length = 40; string default_name = "nobody"; int min_balance = 0; int default_number = 0; int min_number = 0; int max_number = ; private member data include three members: balance double; owner string; accountnumber int; instance (public) methods you should provide the following instance methods: bankaccount (double initbal, string name, int number) - constructor should initialize the balance, account number, and owner as specified. overload the constructor as follows: bankaccount (double initbal, string name) - initializes the balance and owner as specified; randomly generates the account number. bankaccount(string name) - initializes the owner as specified; sets the initial balance to min_balance and randomly generates the account number. void deposit(double amount) - a method that accepts an argument for the deposit amount. the method should add the argument to the account balance. include appropriate value checks when applicable void withdraw(double amount) - a method that accepts an argument for the amount of the withdrawal. the method should subtract the argument from the balance. void withdraw(double amount, double fee) - overload the withdraw method with one that also takes a fee and deducts the fee from the account. include appropriate value check. accessors for each field (instance member). mutators for the account number and owner fields. void display() – a method that clearly shows the bank's data. void close() – a method that closes the current account by appending "closed" to the account name and setting the balance to 0. (the account number should remain unchanged.) this method also decrements the total number of accounts. private static methods private static validation to filter client parameters. these will support your public methods. the class should only allow string names that have between 2 and 40 characters. it will only allow bank account numbers that are between the numbers 0 and . it will also only allow a positive balance. any other value will be considered a user error and the client will not be allowed to set such values. boolean isvalidname( string name) - a method that mutators can use to determine whether a string is legal. this method returns true if the string is not null and its length is between min_length and max_length (inclusive). it returns false, otherwise. boolean isvalidbalance(double initbalance) - a method that mutators can use to determine whether a balance is legal. this method returns true if the balance is greater than 0. it returns false, otherwise. boolean isvalidnumber(int acctnum) - a method that mutators can use to determine whether an account number is legal. this method returns true if the account number is between min_number and max_number (inclusive). it returns false, otherwise. part 2: transaction class main() write a program transaction. java that creates and initializes three bankaccount objects and enters a loop that allows the user to enter transactions for either account until asking to quit. at the beginning of each day, print the summary for each account then have the user enter the transactions for that day.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 04.07.2019 18:10
Afull journal bearing has a journal diameter of 27 mm, with a unilateral tolerance of -0.028 mm. the bushing bore has a diameter of 27.028 mm and a unilateral tolerance of 0.04 mm. the l/d ratio is 0.5. the load is 1.3 kn and the journal runs at 1200 rev/min. if the average viscosity is 50 mpa-s, find the minimum film thickness, the power loss, and the side flow for the minimum clearance assembly.
Answers: 1
question
Engineering, 04.07.2019 18:10
Which one from below is not one of the reasons of planning failures? (clo3) a)-planner is careless. b-planner spend less time in the field but more time on the desk c)-planner is not qualified d)-planner does not have sufficient time to properly plan
Answers: 3
question
Engineering, 06.07.2019 02:30
Define thermoplastic polymers and thermosetting polymers in terms of their structures, and (ii) describe briefly a process suitable for the production of products from each type of polymer.
Answers: 3
You know the right answer?
Bank account class design a bankaccount class that represents a basic bank account. the class constr...
Questions
question
Chemistry, 03.07.2021 08:00
question
Spanish, 03.07.2021 08:00
question
Mathematics, 03.07.2021 08:00
question
Mathematics, 03.07.2021 08:00
question
Engineering, 03.07.2021 08:00
question
Chemistry, 03.07.2021 08:00
question
Social Studies, 03.07.2021 08:10
question
Mathematics, 03.07.2021 08:10
Questions on the website: 13722363