Question: Hi, here is a C++ project about Object-oriented Programming program. Any answers would be appreciated! The description is below: The program 13-15 is about bank

Hi, here is a C++ project about Object-oriented Programming program. Any answers would be appreciated!

The description is below:

Hi, here is a C++ project about Object-oriented Programming program. Any answers

would be appreciated! The description is below: The program 13-15 is about

The program 13-15 is about bank account managing and the source code related are below:

Account.h file:

// 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: Account(double iRate = 0.045, double bal = 0) { balance = bal; interestRate = iRate; interest = 0; transactions = 0; }

void setInterestRate(double iRate) { interestRate = iRate; } void makeDeposit(double amount) { balance += amount; transactions++; } bool withdraw(double amount); // Defined in Account.cpp void calcInterest() { interest = balance * interestRate; balance += interest; } double getInterestRate() const { return interestRate; } double getBalance() const { return balance; } double getInterest() const { return interest; } int getTransactions() const { return transactions; } }; #endif

Account.cpp file:

// Implementation file for the Account class. #include "Account.h"

bool Account::withdraw(double amount) { if (balance

Pr13-15.cpp file:

// This program demonstrates the Account class. #include #include #include #include "Account.h" using namespace std;

// Function prototypes void displayMenu(); void makeDeposit(Account &); void withdraw(Account &);

int main() { Account savings; // Savings account object char choice; // Menu selection

// Set numeric output formatting. cout

do { // Display the menu and get a valid selection. displayMenu(); cin >> choice; while (toupper(choice) 'G') { cout > choice; } // Process the user's menu selection. switch(choice) { case 'a': case 'A': cout

return 0; }

//**************************************************** // Definition of function displayMenu. This function * // displays the user's menu on the screen. * //****************************************************

void displayMenu() { cout

//************************************************************* // Definition of function makeDeposit. This function accepts * // a reference to an Account object. The user is prompted for * // the dollar amount of the deposit, and the makeDeposit * // member of the Account object is then called. * //*************************************************************

void makeDeposit(Account &acnt) { double dollars;

cout > dollars; cin.ignore(); acnt.makeDeposit(dollars); }

//************************************************************* // Definition of function withdraw. This function accepts * // a reference to an Account object. The user is prompted for * // the dollar amount of the withdrawal, and the withdraw * // member of the Account object is then called. * //*************************************************************

void withdraw(Account &acnt) { double dollars;

cout > dollars; cin.ignore(); if (!acnt.withdraw(dollars)) cout

Please leave any information you may need for this project.

Thank you!

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!