Solved

We Want to Change the BankAccount Class So That All

Question 22

Multiple Choice

We want to change the BankAccount class so that all accounts will have a monthly fee.The instance variable monthlyFee will hold the monthly fee.Which of the following constructors properly sets the monthly fee to a default value of 20?


A) public BankAccount (double initialBalance)
{
balance = initialBalance;
monthlyFee = 20;
}
B) public Bankaccount (double initialBalance)
{
balance = initialBalance;
double monthlyFee = 20;
}
C) public BankAccount (double initialBalance)
{
balance = initialBalance;
monthlyFee = initialBalance-20;
}
D) public BankAccount (double initialBalance)
{
balance = initialBalance-20;
}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents