Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class to keep track of a balance in a bank account with a varying annual interest rate. The constructor will set both the

Write a class to keep track of a balance in a bank account with a varying annual interest rate. The constructor will set both the balance and the annual interest rate to some initial values (with defaults of zero). The class should have member functions to change or retrieve the current balance or interest rate. There should also be functions to make a deposit (add to the balance) or a withdrawal (subtract from the balance). Finally, there should be a function that adds interest to the balance at the current interest rate. This function should have a parameter indicating how many years worth of interest are to be added (for example, 0.5 years indicates that the account should have six months interest added). Do not construct an interactive program. Instead, create a test program using assertions. The test program needs to check all the functionality of each class using assertions.

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_2

Step: 3

blur-text-image_3

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

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions

Question

secret communication in communication security

Answered: 1 week ago

Question

3. Is it a topic that your audience will find worthwhile?

Answered: 1 week ago

Question

LO4 Provide an overview of four challenges facing HR today.

Answered: 1 week ago