I need help computing interest and in the main () and array. Here are the full i
ID: 3621018 • Letter: I
Question
I need help computing interest and in the main () and array. Here are the full instructions. Develop a class that contains the fields and functions that a BankAccount needs. Create a clas containg private fields that hold the account number and the account balance. Include a constant static field tha holds the annualjinterest rate of 3 percent earned on account. Create three public member functions for the class:enterAccountData () function prompts the user for values for the account number and balance. Allow neither a negative account number nor one less than 1000 and no negative balance, continue to prompt user for valid values. computeInterest() function that accepts an integer argument represing the number of years the account willearn interist. Function display account number then displays the ending balance of the account eacy year based on the interest rate. displayAccount()function displays details of BankAccount.Create a main() function declare an array of 10 BankAccount ofjects. After first BankAccount objuct is entered, ask user if he wants to coninue or enters 10 entries. Then prompt user for a term of values 1-40 and prompt user until valid value is entered. Pass the array of BankAccount objects, count of valid objects in array, and desired term to a function calculates and desplays the values of each of BankAccounts after given number of years at standard interest rate.
#include<iostream>
using namespace std;
class BankAccount
{
private:
int accountNum;
float accountBal;
float AccountData;
float avgBal;
float getaccountBal;
float getAccountData;
float getavgBal;
public:
void setAccountData ();
void setavg (float);
void setcomputeInterest(float);
void displayAccount (float);
};
void BankAccount::setAccountData()
{
cout << "BankAccount #" << accountNum << "'s number is " << accountNum << endl;
cin >> Please enter your accountNum ;
cout << "Your average balance for the month is" << avgBal << endl;
}
void BankAccount:: setAvg(float avg)
{
const int MAX_NUMBER = 9999;
if(num <= MAX_NUM)
Avg = num;
else
Avg = MAX_NUM;
cout<< "You have one negative in your average " << Avg << endl;
cin << Please enter a positeve amount;
}
void BankAccount :: setcomputeInterest(double interest)
{
const double MAX_INTEREST = 0.3;
if(interest <=MAX_INTEREST)
computeInterest = interest;
else
computeteInterest = 0;
cout << "You can not have a negative interest" << interest << endl;
}
void BankAccount::displayAccount (float)
{
balance = Avg;
}
BankAccount :: float getaccountBal()
{
return accountBal;
}
BankAccount :: float getAccountData ()
{
return AccountData;
}
BankAccount :: float getavgBal()
{
return avgBal ()
}
int main ()
{
const int ACCOUNT = 10;
BankAccount info[ACCOUNT];
int sub;
double balTotal = 0;
double balAverage;
int accountNumber;
bool isFound = false;
for(sub =0; sub<ACCOUNT ; ++sub)
int 1-10;
BankAccount.EnterNumber();
BankAccount.EnterName();
BankAccount.EnterChanges();
BankAccount.EnterDeposit();
BankAccount.EnterWithdraw();
BankAccount.EnterTransfers();
BankAccount.Enterupdate();
BankAccount.Enterautowd();
BankAccount.Enterautodp();
BankAccount.Enteraddperson();
cout << "Please enter a choice 1-10" << 1-10 << endl;
cin >> choice;
cout << "Would you like to continue?" << endl;
cin >> contine;
cout << "How long would you like the term?" << endl;
cin >> Please choose 1-40 mos.
return 0;
}
Explanation / Answer
Dear, Here is the code. //Header file section #include using namespace std; class BankAccount { private: int accountNum; static float interest; float accountBal; //static float interest; public: //static float interest=3; BankAccount(){} void enterAccountData (); void computeInterest(int y); void displayAccount (); }; float BankAccount::interest=0.03; void BankAccount::enterAccountData() { coutaccountNum; while(accountNum>1000) { coutaccountNum;} coutaccountBal; while(accountBalRelated 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.