Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions