Provide the following: I have attached what I have so far below the assignment r
ID: 1800588 • Letter: P
Question
Provide the following: I have attached what I have so far below the assignment requirements...please help complete the code.BankAccount.h
BankAccount.cpp
BankAccountMain.cpp // This file is provided for you.
CheckingAccount.h
CheckingAccount.cpp
SavingAccount.h
SavingAccount.cpp
______________________________________________________________________________________
STEP 1: Create the Multifile Project and the Main (Base) Class
Create a new project that consists of the base class BankAccount.
The BankAccount class should contain, at minimum, the following members.
It should contain data members to store a bank customer's balance and account number. These should be of different and appropriate data types.
It should have function members that do the following:
set the account number;
return the account number;
return the account balance;
deposit money into the account; and
withdraw money from the account.
STEP 2: Create the CheckingAccount Class Derived From the BankAccount Class
The class CheckingAccount should contain, at a minimum, the following members.
It should contain a data member to keep track of the number of withdrawal transactions made on the account. Whenever a withdrawal is made, this number should be incremented.
Override the base class, withdraw-money function, and add the capability to deduct transaction fees from an account using the following guidelines.
The checking account is allowed three free transactions. For each successful withdrawal transaction past the three free transactions, there will be a service fee of 50 cents per transaction. The service fee should be deducted from the account balance at the time the transaction is made.
If there are insufficient funds in the account balance to cover the withdrawal plus the service fee, the withdrawal should be denied.
The function should return a value to indicate whether the transaction succeeded or failed. Transaction fees should be deducted only from successful transactions, but the transaction count should be incremented in either case.
STEP 3: Create the SavingsingAccount Class Derived From the BankAccount Class
The class CheckingAccount should contain, at a minimum, the following members.
It should contain a data member to hold the daily interest rate. The daily interest rate can be calculated from a yearly interest rate by dividing the annual rate by 365.
It should contain a data member to keep track of the number of days since the last transaction or balance inquiry. This should be updated using a random-number generator (reference Lab 1) that will return a value representing the number of days between 0 and 7, inclusive. We will assume that this bank is open every day of the year.
It should contain a data member to hold the interest earned since the last transaction or balance inquiry.
It should contain a function member to set the annual interest rate.
Utilize the base-class functions for both withdrawal and deposit operations for the savings account.
Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made.
If there are insufficient funds in the account balance to cover a withdrawal, the withdrawal should be denied. The number of days since the last transaction or balance inquiry and the interest calculations should still be made.
A value should be returned to indicate whether a withdrawal transaction succeeded or failed.
It should contain a function member to return the interest earned since the last transaction or balance inquiry.
It should contain a function member to return the number of days since the last transaction or balance inquiry.
STEP 4: Test Program Operation
All data-input and data-display operations (cin and cout) should be done in the function main() test program.
The test program should create one checking account and one savings account with initial balances of $100 each using the functions defined in the class definitions. The test program should also assign a unique, five-digit account number to each account and assign an annual interest rate of 3% for the savings account.
The test program should then display a menu that allows the user to select which option is to be performed on which account, including the following.
Make a deposit and specify the amount to a selected or an entered account.
Make a withdrawal and specify the amount to a selected or an entered account.
Return the balance of a selected or an entered account.
For deposit transactions, withdrawal transactions, and balance inquiries, the updated balance and any fees charged or interest earned should also be displayed.
For the savings account, the number of days since last transaction should be displayed.
Exit the program.
Each account operation should display the account number and the account type.
________________________________________________________________________________________
//BankAccountMain.cpp
//Tester function for BankAccount class
#include "BankAccount.h"
#include "CheckingAccount.h"
#include "SavingsAccount.h"
#include <iostream>
#include <iomanip>
#include <windows.h>
using namespace std;
void main(void)
{
int i = 0;
int newAccountNumber = 0;
double depositAmount = 0.0;
double withdrawAmount = 0.0;
double newInterestRate = 0.0;
srand(GetTickCount()); //Seed the random number generator
////////////////////////////////////////////////////////////////////////
//Saving account Test;
CheckingAccount account1;
SavingsAccount account2;
cout << "Enter a six digit integer for your new savings account number: ";
cin >> newAccountNumber;
account2.setAccountNumber(newAccountNumber);
cout << endl;
cout << "Retrieving new savings account number" << endl;
cout << "New Savings Account Number: " << account2.getAccountNumber() << endl << endl;
cout << "Set savings account interest rate" << endl;
cin >> newInterestRate;
account2.setInterestRate(newInterestRate);
cout << "Savings account balance for account # " << account2.getAccountNumber() <<
" is $" << account2.getAccountBalance() << endl << endl;
cout << "Total interest earned: " << account2.getInterestEarned() << " over " << account2.getNumberOfDays()
<< " days" << endl << endl;
cout << showpoint << fixed << setprecision(2);
account2.depositMoney(100.0);
cout << "Savings account balance for account # " << account2.getAccountNumber() << " is $" << account2.getAccountBalance() << endl; // FIXED CODE
cout << "Total interest earned: " << account2.getInterestEarned() << " over " << account2.getNumberOfDays()
<< " days" << endl << endl;
for(i = 0; i < 10; i++)
{
cout << "Withdraw money from savings account" << endl;
if(account2.withdrawMoney(20.0) == false)
cout << "Withdrawal denied, insufficient funds" << endl;
cout << "Savings account balance for account # " << account2.getAccountNumber() <<
" is $" << account2.getAccountBalance() << endl;
cout << "Total interest earned: " << account2.getInterestEarned() << " over " << account2.getNumberOfDays()
<< " days" << endl << endl;
}
////////////////////////////////////////////////////////////////////////
// Checking Account Test
cout << "Enter a six digit integer for your new account number: ";
cin >> newAccountNumber;
account1.setAccountNumber(newAccountNumber);
cout << endl;
cout << "Retrieving new checking account number" << endl;
cout << "New Checking Account Number: " << account1.getAccountNumber() << endl << endl;
cout << "Checking account balance for account # " << account1.getAccountNumber() <<
" is $" << account1.getAccountBalance() << endl << endl;
cout << showpoint << fixed << setprecision(2);
account1.depositMoney(100.0);
cout << "Checking account balance for account # " << account1.getAccountNumber() <<
" is $" << account1.getAccountBalance() << endl << endl;
for(i = 0; i < 10; i++)
{
cout << "Withdraw money from checking account" << endl;
if(account1.withdrawMoney(20.0))
cout << "Monthly free transactions exceeded, $0.50 charge deducted from account" << endl << endl;
else
cout << "Withdrawal denied, insufficient funds" << endl;
cout << "Checking account balance for account # " << account1.getAccountNumber() <<
" is $" << account1.getAccountBalance() << endl << endl;
}
}
_________________________________________________________________________
// BankAccount.cpp
#include "BankAccount.h"
BankAccount::BankAccount(void)
:mInterestRate(0),mPrincipal(0),mLastAccessTime(0) {}
BankAccount::~BankAccount(void) {}
void BankAccount::SetInterestRate(double IR)
{
mInterestRate = IR;
}
void BankAccount::SetPrincipal(int Time, double Amount)
{
mLastAccessTime = Time;
mPrincipal = Amount;
}
double BankAccount::CalculateInterest(int Time)
{
double InterestEarned;
Time = (Time - mLastAccessTime) / 360;
double mInterestRate = ((mInterestRate * Time) / 100) * mPrincipal;
return mInterestRate;
}
double BankAccount::GetInterestRate()
{
return mInterestRate;
}
double BankAccount::GetPrincipal()
{
return mPrincipal;
}
_______________________________________________________________________
// BankAccount.h
#include <iostream>
#include <iomanip>
#include <windows.h>
#pragma once
class BankAccount
{
public:
BankAccount(void);
~BankAccount(void);
double CalculateInterest(int Time);
double GetInterestRate();
double GetPrincipal();
void SetInterestRate(double IR);
void SetPrincipal(int Time, double Amount);
private:
double mInterestRate;
double mPrincipal;
int mLastAccessTime;
};
_______________________________________________________________________
// CheckingAccount.cpp
#include "CheckingAccount.h"
CheckingAccount::CheckingAccount(void) {}
CheckingAccount::~CheckingAccount(void) {}
void CheckingAccount::depositMoney(int Time, double Amount)
{
if ( Time = 0 )
SetPrincipal(Time, Amount);
else
SetPrincipal(Time, (Amount + GetPrincipal()));
}
bool CheckingAccount::withdrawMoney(int Time, double Amount)
{
if (GetPrincipal() >= Amount)
{
GetPrincipal() - Amount;
return true;
}
else
return false;
}
double CheckingAccount::getAccountBalance(int Time)
{
return ( GetPrincipal() + CalculateInterest(Time));
}
_____________________________________________________________________
// CheckingAccount.h
#pragma once
#include "BankAccount.h"
class CheckingAccount : public BankAccount
{
public:
CheckingAccount(void);
~CheckingAccount(void);
void depositMoney(int Time, double Amount);
bool withdrawMoney(int Time, double Amount);
double getAccountBalance(int Time);
double setAccountNumber(double newAccountNumber);
double getAccountNumber();
double getNumberOfDays ();
};
____________________________________________________________________
// SavingsAccount.cpp
// Inheritance class of BankAcount
#include "SavingsAccount.h"
#include <iostream>
SavingsAccount::SavingsAccount(void) {}
SavingsAccount::~SavingsAccount(void) {}
void SavingsAccount::depositMoney(int Time, double Amount)
{
if ( Time = 0 )
SetPrincipal(Time, Amount);
else
SetPrincipal(Time, (Amount + GetPrincipal()));
}
bool SavingsAccount::withdrawMoney(int Time, double Amount)
{
if (GetPrincipal() >= Amount)
{
GetPrincipal() - Amount;
return true;
}
else
return false;
}
double SavingsAccount::getAccountBalance(int Time)
{
return ( GetPrincipal() + CalculateInterest(Time));
}
_______________________________________________________________________
// Savings.H
// Inheritance class of BankAcount
#pragma once
#include "BankAccount.h"
class SavingsAccount : public BankAccount
{
public:
SavingsAccount(void);
~SavingsAccount(void);
void depositMoney(int Time, double Amount);
bool withdrawMoney(int Time, double Amount);
double getAccountBalance(int Time);
double setAccountNumber(double newAccountNumber);
double getAccountNumber();
double setInterestRate(double newInterestRate);
double getInterestEarned ();
double getNumberOfDays ();
};
Explanation / Answer
LogicPro : Hi, LogicPro : My name is XXXXXXXX XXX I can help you. LogicPro : When do you need it? Customer : hopefully by midnight Customer : if not then i need it at LATEST tomorrow by noon Customer : if done by midnight am willing to pay bonus Customer : If i am offline, please go ahead and try to work this for me, no worries you will be paid and as i said by midnight its a bonus Customer : Also if you can make the menu have transfers between the accounts that will also be extra (reminder i need to have the classes in different header files and have different .cpp files such as BankAccount.h, Checking.h, Saving.h Transfer.h, and all those again but.cpp and BankAccountMain.cpp thank you so much. If for some reason you could not do it by tomorrow at noon i will still accept it later during that day. Customer : Sorry i am new to this so i wont pay until i see the actual answer =/ sorry but 65 dollars is alot to just take someones word for it, got to be cautious. LogicPro : I will try my best to provide you answer ASAP. Customer : ok thank you so much LogicPro : Please check back in few hours for the answer. Customer : alright i will, and remember putting in a transfer money to diff account system will earn a bonus :) thank you again LogicPro : okay LogicPro : Download this zip file BankProject_Inheritance_CPP.zip LogicPro : Unzip the file to a folder. Look for .sln file. Double Click on .sln file to open it in Visual Studio 2010. Press F5 to run the program. LogicPro : You can ask me again by using "For LogicPro Only" at the start of your question to get instant and fresh answers. Please leave a positive feedback/bonus after clicking ACCEPT button and ask me if you need more information. Customer : checking the work now, will give you 15 bonus for completing by midnight and 10 if transfer is there Customer : by the way what does this mean? #endif #define #ifndef i dont thinkwe are that advanced yet so if he asks i should be able to answer haha LogicPro : These are preprocessor directives to prevent multiple inclusion of same header files. These lines checks if a header filea has already been included or not Customer : do i need to have them in there? LogicPro : yes. You should have them here. it is very simple to use Customer : okay Customer : ctime and time.h and cstdlib is also new to me what is that? LogicPro : :) LogicPro : let me check Customer : okay last thing where can i put in the phrase "welcome to this Bank" which file should i put that in real quick? LogicPro : I am on different computer. Let me check LogicPro : Downloading the file Customer : okay also i need " It should contain a data member to keep track of the number of withdrawal transactions made on the account. Whenever a withdrawal is made, this number should be incremented." and the transaction fees of 50 cents after 3 transactions LogicPro : ok Customer : i need it to declare it as well like it needs to say 50 cents has been deducted due to more than 3 transactions has been done today Customer : or something Customer : last thing that is missing is "It should contain a data member to keep track of the number of days since the last transaction or balance inquiry" Customer : after those Customer : It should contain a function member to set the annual interest rate. 5. Utilize the base-class functions for both withdrawal and deposit operations for the savings account. 6. Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made. Customer : i think thats the whole thing thats missing that paragraph there... i will add a bonus because i know youve been hard at work haha Customer : so when its done your looking at 100 or so in total LogicPro : ok LogicPro : ok :) LogicPro : I have included it all. Will have to point you to it Customer : wow that was fast haha LogicPro : please wait Customer : okay LogicPro : thank you Customer : hey i have to go for a couple of hours i will be checking then to see what you got. Pretty much what i need is the person who will be looking at this needs to know all of these things such as "last transaction date" , "annual fee" and "more than 3 transactions have been made adding 50 cents fee" are in there by the program actually telling him while hes performing his withdrawals and balance inquiries and so on. also the "welcome to this place Bank" (in can fill in the blank in the source code). Customer : thank you again so much, will talk to you later today! LogicPro : I am almost done. Please wait Customer : okay okay ill try to hold em off haha LogicPro : okay LogicPro : two of your comments are valid but not stated in original requirements. Customer : o.0 oh it must of cut off LogicPro : others are under standing issues LogicPro : np LogicPro : Let us discuss them quickly Customer : okay LogicPro : I will provide the modified code after that Customer : okay LogicPro : Valid: LogicPro : ctime and time.h and cstdlib is also new to me what is that? >>>Removed it from project. These were unused LogicPro : Valid: LogicPro : okay last thing where can i put in the phrase "welcome to this Bank" which file should i put that in real quick? >>included statement - cout3) { amount=amount+.50; } LogicPro : let me know once you see this code in CheckingAccount.cpp Customer : i do see it LogicPro : lets move to next LogicPro : it is valid and I have made changes in code LogicPro : i need it to declare it as well like it needs to say 50 cents has been deducted due to more than 3 transactions has been done today Customer : okay LogicPro : >>I made changes to CheckingAccount.cpp so that it will now say this statement LogicPro : if(numberOfWithdrawls>3) { amount=amount+.50; cout look for lines: void SavingsingAccount::setAnnualInterestRate(double rate) { annualInterestRate=rate; in SavingsingAccount.cpp LogicPro : ok? Customer : okay LogicPro : 5. Utilize the base-class functions for both withdrawal and deposit operations for the savings account. >>>Methods are being inherited from BankAccount.cpp in other cpp files so they are using base-class functions for both withdrawal and deposit operations LogicPro : ok? Customer : yea sorry i didnt mean to add that one there haha LogicPro : last one Customer : k LogicPro : 6. Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made. >>it is being done, see codedouble BankAccount::getBalance() { return balance; } LogicPro : in BankAccount.cpp LogicPro : and LogicPro : code LogicPro : double SavingsingAccount::getBalance() { double amount; numberOfDaysLastTrans=rand()%7; double bal=BankAccount::getBalance(); amount=bal + ( dailyInterestRate*numberOfDaysLastTrans); return amount; } LogicPro : in LogicPro : SavingAccount.cpp Customer : oh okay i see it LogicPro : So it is fulfilling all requirement. Customer : yes Customer : thank you so much LogicPro : Wait while I provide you modified files Customer : okay LogicPro : uploading LogicPro : few seconds left LogicPro : internet is too slow today LogicPro : online? Customer : yep LogicPro : http://www.mediafire.com/file/n20znhm2cnpv88l/BankProject_Inheritance_CPP.zip LogicPro : Download from there Customer : okay just incase can u email it to me? Customer : my internet is a bit slow as well LogicPro : Apologies, we are not allowed to share email. You can download and email to yourself Customer : oh ok did not know LogicPro : or you can come back here anytime to get it even after you accept after letting me know LogicPro : You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant and fresh answers. It will ensure that question is for me.Please leave a positive feedback/bonus after clicking ACCEPT and ask me if you need more info. Customer : alright my friend thank you so much i will now hit the accept Customer : and i will definitely refer myself to you next timeRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.