Question: Java Languge 1- Design a class named Account that contains : Three data filed: - A private int data field named id for the account
Java Languge
1- Design a class named Account that contains
: Three data filed:
- A private int data field named id for the account (default 0).
- A private String data field named Name for the customer.
Write a test program that creates an Account object with an account ID of 192001, a customer name is Mohammed. Then print Customer Id, name and the old balance. Use the deposit method to deposit $3,000, then use the withdraw method to withdraw $2,500, and print the new balance.
- A private double data field named balance for the account (default 0).
2-- A constructor that creates an account with the specified id and Customer Name. Define accessor methods for id, balance and name. A method named withdraw that withdraws a specified amount from the account. A method named deposit that deposits a specified amount to the account
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
