Answer:
C++
#include <iostream>
using namespace std;
////////////////////////////////////////////
class BankAccount {
int balance;
public:
BankAccount() {
balance = 0;
}
void setBalance(int balance) {
this->balance = balance;
}
};
////////////////////////////////////////////
int main() {
BankAccount ba[300];
ba[47].setBalance(92);
ba[102].setBalance(1007);
return 0;
}
Step-by-step explanation:
Create class BankAccount. Create constructor and define setBalance method.
In main function, declare "ba" array with 300 objects of type BankAccount.
And use the public setBalance method to set the required balance value.