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

// IntroClasses2.cpp #include using namespace std; class Bank_Acct { public: Ban

ID: 3558979 • Letter: #

Question

// IntroClasses2.cpp #include using namespace std; class Bank_Acct { public: Bank_Acct( ); // default constructor Bank_Acct(double); double Check_Balance( ); void Deposit(double); void Withdrawal(double); private: double balance; }; Bank_Acct::Bank_Acct() { balance = 0; } Bank_Acct::Bank_Acct(double amount) { balance = amount; } double Bank_Acct::Check_Balance() { return balance; } void Bank_Acct::Deposit(double amount) { balance = balance + amount; } void Bank_Acct::Withdrawal(double amount) { balance = balance - amount; } int main() { Bank_Acct my_Acct; Bank_Acct your_Acct(10340.85); // initial account balance for your account cout << "Your account balance = " << your_Acct.Check_Balance() << endl; your_Acct.Deposit(512.30); // deposit into your account cout << "Your account balance = " << your_Acct.Check_Balance() << endl; your_Acct.Withdrawal(8284.56); // withdraw from your account cout << "Your account balance = " << your_Acct.Check_Balance() << endl; // initial account balance for my account cout << "My account balance = " << my_Acct.Check_Balance() << endl; my_Acct.Deposit(2516.83); // deposit into my account cout << "My account balance = " << my_Acct.Check_Balance() << endl; my_Acct.Withdrawal(25.96); // withdraw from my account cout << "My account balance = " << my_Acct.Check_Balance() << endl; return 0; } Question 9: Write the statement (i.e., the actual line of code) in the program in Step 2 that initializes the balance of the object your_Acct. Question 10: Give the full name of the function (also referred to as the function header) that initialized the object your_Acct. Also, what kind of function is it? (Is it a type of constructor?) Question 11: What happens if you add the statement my_Acct.balance = 0; to the main function of the program in Step 2 after the object declarations? Explain your answer. Question 12: What do we mean when we use the following phases? a. inside the class b. outside the class

Explanation / Answer

9) balance = amount;

10) Bank_Acct(double); ->default constructor of bank_acct class

11) Error : error: