Question: // 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:
 // Specification file for the Account class. #ifndef ACCOUNT_H #define ACCOUNT_H
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:
class Account { private: double balance; // Account balance double interestRate; //

select one of the following options: A) Display the account balance B) Display the number of transactions C) Display the interest earned this period D) Make a deposit E) Make a withdrawl F) Add interest for this period G) Exit this program Enter your choice: Select one of the following options: A) Display the account balance B) Display the number of transactions C) Display the interest earned this period D) Make a deposit E) Make a withdrawl F) Add interest for this period G) Exit this program Enter your choice: d Enter the amount to deposit: 200.00 Select one of the following options: A) Display the account balance B) Display the number of transactions C) Display the interest earned this period D) Make a deposit E) Make a withdrawl F) Add interest for this period G) Exit this program Enter your choice: e Enter the amount to withdraw: 500 That is more money than you have. Check your balance. Select one of the following options: A) Display the account balance B) Display the number of transactions c) Display the interest earned this period D) Make a deposit E) Make a withdrawl F) Add interest for this period G) Exit this program Enter your choice

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!