Answered step by step
Verified Expert Solution
Link Copied!

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:
image text in transcribed
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:
image text in transcribed
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

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 Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

=+Where do you want to live and work?

Answered: 1 week ago

Question

=+1 Where are the best places in the world to live (and work)?

Answered: 1 week ago

Question

=+Are you interested in working on global teams?

Answered: 1 week ago