CSE 143, Summer 2000 Quiz 0 (with sample solutions) 1. Given the following class declaration for BankAccount, write a definition for the default constructor which initializes the balance to zero. class BankAccount { private: double balance; char name[MAX_NAME_LENGTH]; public: BankAccount(); BankAccount(char newName[]); BankAccount(double newBalance, char newName[]); }; 2. If the following line of code is correct, what are the most likely types of variables i and n? BankAccount newAccount(i, n); 3. Which of the three BankAccount constructors, if any, is called in this code, and how many times? BankAccount accountList[100]; ............................................................ solutions 1. BankAccount::BankAccount() { balance = 0.0; } 2. i's type is double, n's type is char [] or char * 3. default constructor, i.e. BankAccount(), called 100 times