Answered step by step
Verified Expert Solution
Question
1 Approved Answer
// Specification file for the Account class. #ifndef ACCOUNT_H #define ACCOUNT_H class Account { private: double balance; // Account balance double interestRate; // Interest rate
// Specification file for the Account class.
#ifndef ACCOUNT_H
#define ACCOUNT_H
class Account
{
private:
double balance; // Account balance
double interestRate; // Interest rate for the period
double interest; // Interest earned for the period
int transactions; // Number of transactions
public:
// Constructor
Account(double iRate = 0.05, double bal = 0);
// Setters
void setInterestRate(double iRate);
// Getters
double getBalance();
double getInterest();
int getTransactions();
// Methods
void makeDeposit(double amount);
bool withdraw(double amount);
void calcInterest();
};
#endif
a) Based on the Bank Account information in the code above, create a class that defines the bank account object. You can download, copy and paste the attached file for your header file.
Create at menu driven program that allows the user use the class. Here is an example menu:
b) I would create the menu, make sure you can exit the program. Then do one item at a time, testing it when you're finished.
For the Add interest for this period, just return the balance times the rate. Don't worry about any length of time for the period.
Here is a short sample output:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started