itialBalance; } public Account () { balance = 0; } public void deposit (double amount){ balance += amount; // Bala

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 13PE
icon
Related questions
Question
100%

public Account (double initialBalance){
balance = initialBalance;
}
public Account () {
balance = 0;
}
public void deposit (double amount){
balance += amount; // Balance = balance + amount
}
public void withdraw (double amount){
balance -= amount; // balance = balance - amount
}
public void close (){
balance = 0;
}
public String toString(){
return "balance: " + balance;
}

}

 

Modify the Account class by adding two instance variables containing the customer's name and the account number. Both will be String objects. Modify the primary constructor for the Account class so that it takes three parameters: the balance, the customer's name, and the account number. Add instance methods named getCustomerName and getAccountNumber that return the customer name and account number.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Keywords
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT