Question: Lab 8 Object-Oriented Programming 2 Objectives: After performing this lab, the students should be able to implement class constructors use separate files for programs using

 Lab 8 Object-Oriented Programming 2 Objectives: After performing this lab, the

Lab 8 Object-Oriented Programming 2 Objectives: After performing this lab, the students should be able to implement class constructors use separate files for programs using classes This lab is a continuation of lab 7. Activities Provide your C++ source code and screenshots of your program outputs. Add the following to your class definition for the BankAccount class: Member variable o interest: a double variable between 0 and 1 representing the daily interest rate Member methods default constructor: sets the account ID to 00000-00000, the account holder name to the empty string, and account balance to O overloaded constructor: sets the account ID to a given ID, the account holder name to the given string, and account balance to a given number o addDailyInterest: calculates the daily interest (balance x interest rate) and adds it to the balanace Print: displays the state of the account (values of the member variables in an organized format), including whether the account is active o Implement all class member functions. Write a simple drive program that tests the BankAccount class. The driver program should create at least two BankAccount objects using the constructors and invoke each of the new member methods added in this lab. Display the states of the BankAccount object where appropriate. By observing expected outputs from the driver program, you should obtain assurance that your class is implemented correctly. Use separate files to organize this program: main.cpp: contains the main program BankAccount.h: contains the class definition of the BankAccount class BankAccount.cpp: contains the member function definitions BankAccount class Page 1 of 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!