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, 04.07.2019 18:10
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
At 12 noon, the count in a bacteria culture was 400; at 4: 00 pm the count was 1200 let p(t) denote the bacteria cou population growth law. find: (a) an expression for the bacteria count at any time t (b) the bacteria count at 10 am. (c) the time required for the bacteria count to reach 1800.
Answers: 1
question
Engineering, 04.07.2019 18:20
An engine runs on the ideal diesel cycle. the cycle has a compression ratio of 20 and a cutoff ratio of 2. the highest temperature in the cycle is 1200 k. if the heat into the system is 300 kj/kg of working fluid and using variable specific heats determine the work produced per mass of working fluid
Answers: 3
question
Engineering, 04.07.2019 18:20
An open feedwater heater operates at steady state with liquid entering at inlet 1 with t? = 40°c and pl = 1 .2 mpa. water vapor att2-200°c and p2 = 1.2 mpa enters at inlet 2. saturated liquid water exits with a pressure of pa 1.2 mpa. neglect heat transfer with the surroundings and all kinetic and potential energy effects, determine the mass flow rate of steam at inlet 2 if the mass flow rate of liquid water at inlet 1 is given as 2 kg/s.
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
Mathematics, 08.12.2019 04:31
question
History, 08.12.2019 04:31
question
Biology, 08.12.2019 04:31
question
Mathematics, 08.12.2019 04:31
Questions on the website: 13722361