A bank maintains the accounts for its customers The bank off

A bank maintains the accounts for its customers. The bank offers customers two type of accounts - a checking account and a savings account. The checking account charges ustomers a fixed service charge of $25.00 per month. The savings account yields a fixed interest rate of 3% per year on the monthly balance. The bank allows cutomers to make deposits, withdrawals, and to get their balance at any time.

From the set of responses below select those that best describe an interface for this situation.

              (I)                                                                                          (II)
              
public interface Banking                                                          public interface Banking
{                                                                                                   {
          double CHECKING_RATE = 25.0;                                         double CHECKING_RATE = 25.0;
          final double SAVING_RATE   = 0.03;                                    double SAVING_RATE   = 0.03;
               
          void deposit(double amount);                                                void deposit(double amount);
          double withdraw(double amount);                                        double withdraw(double amount);
          double getBalance();                                                               static double money = getBalance();
}                                                                                                  }

                  (III)                                                                                      (IV)
public interface Bankikng                                                      public interface Banking
{                                                                                                 {
         static double CHECKING_RATE = 25.0;                                 double CHECKING_RATE = 25.0;
         double SAVING_RATE   = 0.03;                                               double SAVING_RATE   = 0.03;
               
         void deposit(double amount);                                                  void deposit(double amount);
         abstract double withdraw(double amount);                           double withdraw(double amount);
         double getBalance();                                                                  static double getBalance(){ return amount};
}                                                           }

                      (V)                                                                                        
public interface Bankikng                                                         
{                                                                                                  
         static double CHECKING_RATE = 25.0;                                        
         static final double SAVING_RATE   = 0.03;                                                      
               
         publicabstract void deposit(double amount);                                                       
         abstract double withdraw(double amount);                               
         double getBalance();                                                                       
}                                           

SELECT ALL POSSIBLE RESPONSES

Select one or more:

a. I

b. V

c. II

d. III

e. IV

Solution

Answer : V

(V)                                                                                        
public interface Bankikng                                                         
{                                                                                                  
         static double CHECKING_RATE = 25.0;                                        
         static final double SAVING_RATE   = 0.03;                                                      
               
         publicabstract void deposit(double amount);                                                       
         abstract double withdraw(double amount);                               
         double getBalance();                                                                       
}   

Explaination :

Let me know if you have any doubts.

Thanks.

A bank maintains the accounts for its customers. The bank offers customers two type of accounts - a checking account and a savings account. The checking account
A bank maintains the accounts for its customers. The bank offers customers two type of accounts - a checking account and a savings account. The checking account

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site