Cevelop a BankAccount structure containing fields for account number account bal
ID: 3620791 • Letter: C
Question
Cevelop a BankAccount structure containing fields for account number account balance, and annual interest rate earned. Use same structure for using void () enteraccountdata, compute interest accepting bank account, display account, and main declare bankaccount ofject and continues to get bank account values from the user until value is 0 in bank account. The program I wrote below only has arrays but is needs more work in the math parts and now we are adding void with structure.#include<iostream>
using namespace std;
struct Account
{
int accountNum;
double accountBal;
double interestRate;
double average;
double total;
};
int main()
{
const int ACCOUNTNUMBER = 5;
Account account[ACCOUNTNUMBER] = {{0003210, 129.000,0.015}, {004312, 245.000,0.015},
{0005367, 600.000,0.015}, {0006456, 1.00042,0.015}};
int isFound = 0;
int neededAcct;
int x;
cout << "Enter the account number you want ";
cin >> neededAcct;
for(x = 0; x< ACCOUNTNUMBER; ++x)
{
double total;
double accountBal;
total += accountBal;
cout << accountBal << " ";
}
if(neededAcct == account[x].accountNum)
{
cout << "The account number is " <<
account[x].accountNum << endl;
isFound = 1;
}
if(isFound == 0)
cout << "Sorry - no such account number" << endl;
double total; double accountBal; double interestRate;
total = accountBal + interestRate;
cout << "Total amount in account " <<
total << endl;
system("pause");
return 0;
}