The program I wish to create is one that does common bank functions like you wou
ID: 3636700 • Letter: T
Question
The program I wish to create is one that does common bank functions like you would in a bank.These are my thoughts on how to approach the program:
The first .cpp file will hold the menu and the choice:
This are the choices in the menu (basic output):
Create an Account
Make A Deposit
Make a Withdrawal
Print Bank Statement
Projected Balance
Exit
And a SWITCH or IF statement will hold the choice 1-6 as well as calling the functions
The .h file will hold the functions declarations for those choices.
A separate .cpp file will link to the first .cpp file. The actual functions will be held in this .cpp file.
So in all, 2 .cpp files and a .h file.
.cpp #1 - Menu and the ability to choose.
.h - function declarations
.cpp #2 - The actual functions
Link the .cpps in a single project. - Please use Dev C++.
The full specifications are as follows:
Your program will act as a bank. The general behavior will be:
A customer walks into the bank.
The customer opens an account. They will enter their name, and make an initial deposit. You can determine an interest rate based on their deposit amount. Be sure to provide good customer service by explaining what the interest rate options are.
Now that the account is open, they can perform transactions. The choices of transaction type are:
Make a deposit - Ask the amount, add it to the balance, display the balance.
Make a withdrawal - Ask the amount, subtract it from the balance, display the balance. (What if they want to withdraw more than their balance?)
Print a statement - A statement of their balance and interest rate, including their name.
Projected balance - Let the user specify a number of years, and based on the current balance and interest rate, tell them what will be the balance in that many years.
After the customer leaves, handle the next customer in line. You may add other functionality if you wish, or embellish these. For example, you might want to have an array of the accounts, and recognize an existing customer if they come back.
To accomplish this, you will create a class for the bank account, containing the customer name, balance, and interest rate. The class will contain functions for each of the desired operations. You might want to call the statement function to show the balance at the end of the deposit and withdrawal functions, rather than duplicating that code. No globals except for constants and type definitions. Pass values as needed
Explanation / Answer
please rate - thanks
as per my message, I'll message you the rest later today
#include <iostream>
#include <string>
using namespace std;
class Account{private:
string name;
int balance;
double rate;
public:
void create( )
{
}
void deposit(int val)
{balance+=val;
}
void withdraw(int val)
{if(val>balance)
cout<<"Debit amount exceeded account balance. ";
else
balance-=val;
}
void printStatement()
{return balance;
}
double predictBalance()
{ double pred;
pred=balance*rate;
return pred;
}
};
int main()
{
system("pause");
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.