Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

// TODO: Create getAccountNumber method to return the value of the private // ac

ID: 3770317 • Letter: #

Question

// TODO: Create getAccountNumber method to return the value of the private
// accountNumber variable.

//TODO: Create a setAccountNumber method that does not return a value and
// accepts a String parameter. Assign the parameter's value to the
// private accountNumber variable.
//************************************************************************

//************************************************************************
// TODO: Create getAccountName method to return the value of the private
// accountName variable.
  
//TODO: Create a setAccountName method that does not return a value and
// accepts a String parameter. Assign the parameter's value to the
// private accountName variable.
//************************************************************************

//************************************************************************
  
// TODO: Create getAccountBalance method to return the value of the private
// accountBalance variable.
  
//TODO: Create a setAccountBalance method that does not return a value and
// accepts a BigDecimal parameter. Assign the parameter's value to the
// private accountBalance variable.
  

public class Account {
private String accountNumber, accountName;
private BigDecimal accountBalance;
  
public Account(){
  
accountNumber = "";
accountName = "";
accountBalance = new BigDecimal("0");
}
public Account(String anum, String anam,BigDecimal abal){
  
accountNumber = "";
accountName = "";
accountBalance = new BigDecimal("0");
}
public String getaccountNumber() {
return accountNumber;
}
public void setaccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getaccountName() {
return accountName;
}
public void setaccountName(String accountName) {
this.accountName = accountName;
}
public BigDecimal getaccountBalance() {
return accountBalance;
}
public void setaccountBalance(BigDecimal accountBalance) {
this.accountBalance = accountBalance;
}
}

Explanation / Answer

Program: