Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I want you to make a program in java, it should match my output that shown in this pic. Design the following two classes Account
I want you to make a program in java, it should match my output that shown in this pic.
Design the following two classes Account that contains " balance: double data field "date: Date data field. Use Date class from the java.util package accountNumber: long data field. You should generate this value randomly. The account number should be 9 digits long. You can use the random method from java Math class. annuallnterestRate: double data field. customer: customer data field. This is the other class that you will have to design. See description below. The accessor and mutator methods for balance, annuallnterestRate, date, and customer The accessor method for accountNumber A constructor that creates an account with the specified customer, balance, and interest rate. Also, it should generate the account number and the current date " " " " " "A method called getMonthlylnterestRate that returns the monthly "A method called getMonthlylnterest that returns the monthly interest " A method called generateAccountNumber that returns a 9 digit interest rate. Monthly Interest Rate is the annuallnterestRate/12 Monthly interest is the balance *monthlylnterestRate number A method called deposit that takes a parameter of type double. This method will add the value of the parameter to the balance. Make sure not to accept any negative values " "A method called withdraw that takes a parameter of type double. This method will subtract the value of the parameter from the balance Make sure not to accept any negative values or values greater than existing balance Override toString method. This method should return all the information about this account " Customer class that contains "firstName: String data fiela " lastName: String data field " address: String data field " age: int data field The accessor and mutator methods for firstName, lastName, age, and address id: int data field. The first customer should have an id of32000 and for any new customer add 10 Constructor that creates an customer with the specified first name, last name, address, and age. Also, it should generate the customer's id. Override toString method. This method should return all details about this account (firstName, lastName, address, id, and age) Override equals method. This method should return true if the calling object is equal to the other object. * " " " Write a test program that creates an BankAccount object. Make sure to test all the methods in both the BankAccount and Customer objects Note: You don't have to use Scanner to read the user's input. It suffice to hard code the values in the driver. Also, make sure that all your mutator (setter) methods validate the inputs Here is the output that you should get if you run your program with the Driver below: customer-1 toString: Customer ID 32000 FirstName-Sarah LastName-Smith Age- 24 Address-319 grand ave] custome-2 toString: Customer [ID-32010 FirstName-John LastName-Smith Age- 34 Address-12 nicollect] Current Balance: 1330.0 Current Balance: 1530.0 Account Number: 411341391 Account Created date: Fri 1 Jun 18 Customer ID: 32000 Monthly Inerest Rate: 0.375 Monthly Interest: 5.7375 Current Balance: 1530.0 Monthly Interest: 4.6125 Account-1 toString output: BankAccount [Balance 1230.0 date- Fri Jun 01 19:13:54 CDT 2018 AccountNumber- 411341391 InterestRate- 4.5 Customer [ID 32000 FirstName-Sarah LastName-Smith Age 24 Address-319 grand ave]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started