can anyone help me pls (coding)

1) Defines a client class that contains method main( ) with following tasks :- a. Declares an object of type “Accounts” class under the name “Customer” Note: - no initialization for “Customer” is required at this stage. b. Asks the user to enter an integer account#. c. If account# entered is greater than 9999, the user is considered as a new customer .A default class constructor (without parameters) is used to create an object with the name “Customer”. In this case, customer balance will start with zero as shown by the description of class “Accounts” in number (2) below. d. If account# is less than or equal to 9999 then the customer is to be asked to enter an initial balance to start with. Following that, a constructor of class “Accounts” with a double parameter is invoked by passing an initial balance value that is set by the user to create an object with the name “Customer”. e. Regardless of which constructor of the two class constructors is used, the account# value is to be assigned to the property “AccountNo” of the “Customer” object. f. Repeatedly asks the customer (by implementing a loop) to select one out of four choices as follows : i. “V/v” to view the balance by calling method ViewBalance( ) . ii. “E/e” to exit the program. iii. “D/d” to deposit an amount entered by the user when prompted. The amount entered is send to method Transaction( ) of object “customer” as a parameter. iv. “W/w” to withdraw an amount entered by the user when prompted. The amount entered is send to method Transaction( ) of object “customer” as a parameter value after negating it . Note:- Method ViewBalance( ) is to be called immediately after calling method Transaction( ) in case of options “D” and “W”. 2) Defines class “Accounts” that is to be instantiated from within the client class stated above:- a. Declares a double property with the name “Balance” and an integer property under the name “AccountNo”. b. Declares a default constructor (without parameter). i. Transfers the execution to another constructor. A zero will be passed as a parameter value to the latter constructor. c. Declares a second constructor (with one parameter) that calls method Transaction( ) by passing the amount received by the constructor parameter . d. Defines method Transacation( ) that only adds a value received by its parameter to the Property “Balance”. e. Defines method ViewBalance( ) that displays the current values of both the AccountNo and the Balance.

Add new comment