G
gbvk
Hi,
I'm currently writing a C++ program for an assignment.
"Create a C++ program to manage 10 bank accounts... "
To include;
"An appropriate type definition to store the name, account number and
balance of a bank account
An array to record the details of the 10 bank accounts
Functions/procedures to update/interrogate the bank accounts array."
I have all the code for a single bank account where you can depost/
withdaw and vew balance, but, I’m not quite sure about arrays and how
to access them, so my idea was this:
float account [2][10];
// account munber on [0][x]
account[0][0] = 10001;
account[0][1] = 10002;
account[0][2] = 10003;
account[0][3] = 10004;
account[0][4] = 10005;
account[0][5] = 10006;
account[0][6] = 10007;
account[0][7] = 10008;
account[0][8] = 10009;
account[0][9] = 10010;
// account balance on [1][x]
account[1][0] = 0;
account[1][1] = 0;
account[1][2] = 0;
account[1][3] = 0;
account[1][4] = 0;
account[1][5] = 0;
account[1][6] = 0;
account[1][7] = 0;
account[1][8] = 0;
account[1][9] = 0;
But I have no idea how to include a name, or how I would start with
"insert account number" and get this to pull details.
I'm currently writing a C++ program for an assignment.
"Create a C++ program to manage 10 bank accounts... "
To include;
"An appropriate type definition to store the name, account number and
balance of a bank account
An array to record the details of the 10 bank accounts
Functions/procedures to update/interrogate the bank accounts array."
I have all the code for a single bank account where you can depost/
withdaw and vew balance, but, I’m not quite sure about arrays and how
to access them, so my idea was this:
float account [2][10];
// account munber on [0][x]
account[0][0] = 10001;
account[0][1] = 10002;
account[0][2] = 10003;
account[0][3] = 10004;
account[0][4] = 10005;
account[0][5] = 10006;
account[0][6] = 10007;
account[0][7] = 10008;
account[0][8] = 10009;
account[0][9] = 10010;
// account balance on [1][x]
account[1][0] = 0;
account[1][1] = 0;
account[1][2] = 0;
account[1][3] = 0;
account[1][4] = 0;
account[1][5] = 0;
account[1][6] = 0;
account[1][7] = 0;
account[1][8] = 0;
account[1][9] = 0;
But I have no idea how to include a name, or how I would start with
"insert account number" and get this to pull details.