The BIG Picture base class contains data and operations common to all derived cl
ID: 3595498 • Letter: T
Question
The BIG Picture base class contains data and operations common to all derived classes. Rather than ng these fields in each derived class, we let the derived classes inherit them class. A derived class can override inherited virtual methods and add from the base additional methods and data fields. nheritance supports the IS-A relationship in which a derived class object is also a type of base class object. Test Your Understanding 1. Each class, except Object, derives from another class either implicitly or explic- itly. For each of the following classes, from which class does it derive? a. SavingsAccount b. String c. BankAccount e. CheckingAccount d. Address 2. Declare and initialize a SavingsAccount, s, with an initial balance of $50.00 and 3. Declare and initialize a CheckingAccount, c, which requires a minimum bal- 4. Describe the output from each of the following, where s is the SavingsAccount an interest rate of 3.5 percent. ance of $1500 to avoid the 35 cent service charge per check. defined in question 2, and Name president = new Name ("Abraham", "Lincoln"); 10.1 Derived ClassesExplanation / Answer
1.
a) derived from BankAccount
b) derived from Object
c) derived from Object
d) derived from Object
e) derived from BankAccount
2.
SavingsAccount *s = new SavingsAccount(50, 3.5);
3.
CheckingAccount *c = new CheckingAccount(1500, 35);
4.
Question not comeplete
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.