The purpose of this assignment is to get you familiar with S
Solution
#include<stdio.h>
 #include<stdlib.h>
 #include<iostream>
 using namespace std;
 struct bank{
        int accNumber;
         string Fname, Lname;
         float balance;
 };
 static int j=0;
 struct bank B[5];
 void read_from_file(const char* filename){
        FILE *fp;
         char *word[50];
         int i, flag = 0, count=0;
         for(i=0; i<50; i++)
                 word[i] = (char *)malloc(20);
         i=0;
         fp = fopen(filename, \"r\");
         while(fscanf(fp, \"%s\", word[i++])!=EOF){
                 count++;
                 if(count == 4){
                         B[j].accNumber = atoi(word[0]);
                         B[j].Fname = word[1];
                         B[j].Lname = word[2];
                         B[j].balance = atof(word[3]);
                         j++;
                         i= 0;
                         count =0;
                 }
         }
         for(i=0; i<j; i++)
                 cout<<B[i].accNumber<<\" \"<<B[i].Fname<<\" \"<<B[i].Lname<<\" \"<<B[i].balance<<\"\ \";
         fclose(fp);
 }
 int addAccount(){
        int accNum;
         string fname, lname;
         float balance;
        cout<<\" --- Provide details ---\ \";
         cout<<\"Acc Number: \"; cin>>accNum;
         for(int i=0; i<j; i++)
         {
                 if(B[i].accNumber == accNum)
                 {     
                        cout<<\"Error: No changes should be made to the database\ \";
                         return 0;
                 }
         }
         j = j + 1;
         B[j].accNumber = accNum;
         cout<<\"first name: \"; cin>>B[j].Fname;
         cout<<\"last name: \"; cin>>B[j].Lname;
         cout<<\"Balance:\" ;cin>>B[j].balance;
 }
 void deleteAccount(){
        int accNum;
         cout<<\"Enter account number: \"; cin>>accNum;
         for(int i=0; i<j; i++)
         {
                 if(B[i].accNumber == accNum){
                         for(int k=i; k<j-1;k++)
                                 B[k] = B[k+1];
                 }
         }
 }
 void searchAccount(){
        int accNum;
         cout<<\"Enter account number: \"; cin>>accNum;
         for(int i=0; i<j; i++)
         {
                 if(B[i].accNumber == accNum){
                         cout<<B[i].accNumber<<\"\\t\"<<B[i].Fname<<\"\\t\"<<B[i].Lname<<\"\\t\"<<B[i].balance<<\"\ \";
                  }
         }
 }
 int withdraw()
 {
         float withd;
         int accNum;
         cout<<\"Enter account number from you want to withdraw:\";
         cin>>accNum;
         for(int i=0; i<j; i++)
         {
                 if(B[i].accNumber == accNum)
                 {
                         cout<<\"Enter withdraw amount : \";
                         cin>>withd;
                         if(B[i].balance >= withd){
                                 B[i].balance = B[i].balance - withd;
                                 cout<<\"Total :\"<<B[i].balance<<\"\ \";
                         }
                         else{
                                 cout<<\"Error: No changes should be made to the database\ \";
                                 return 0;
                         }
                 }
                 else{
                         cout<<\"Error: No changes should be made to the database\ \";
                         return 0;
                 }
         }
 }
 int deposit()
 {
         float dep;
         int accNum;
         cout<<\"Enter account number you want to Deposit:\";
         cin>>accNum;
         for(int i=0; i<j; i++)
         {
                 if(B[i].accNumber == accNum)
                 {
                         cout<<\"Enter deposit amount : \";
                         cin>>dep;
                         B[i].balance = B[i].balance + dep;
                         cout<<\"Total :\"<<B[i].balance<<\"\ \";
                 }
                 else{
                         cout<<\"Error: No changes should be made to the database\ \";
                         return 0;
                 }
         }
 }
 int transfer(){
        float tran;
         int fromAcc, toAcc, fr, to, i, f1, f2;
         cout<<\"Enter account number you want to transfer from \"; cin>>fromAcc;
         cout<<\"to \"; cin>>toAcc;
        for(i=0; i<j; i++)
                 if(B[i].accNumber == fromAcc){
                         f1 = 1;
                         fr = i;
                 }
         for(i=0; i<j; i++)
                 if(B[i].accNumber == toAcc){
                         f2 = 1;
                         to = i;
                 }
         if(f1 == 1 && f2 == 1)
         {
                 cout<<\"Enter amount to transfer : \";
                 cin>>tran;
                 if(B[fr].balance >= tran){
                         B[to].balance = B[to].balance + tran;
                         B[fr].balance = B[fr].balance - tran;
                 }
                 else{
                         cout<<\"Error: No changes should be made to the database\ \";
                         return 0;
                 }
         }
         else{
                 cout<<\"Error: No changes should be made to the database\ \";
                 return 0;
         }
 }
 void list(){
        for(int i=0; i<j; i++)
                 cout<<B[j].accNumber<<\"\\t\"<<B[j].Fname<<\"\\t\"<<B[j].Lname<<\"\\t\"<<B[j].balance<<\"\ \";
  }
 int main(){
        int op;
         char ch;
         read_from_file(\"account.txt\");
         do{
                 cout<<\"-- Operations menu --- \ \";
                 cout<<\"\\t1. Add an Account\ \\t\"
                         \"2. Delete an Account\ \\t\"
                         \"3. Search for an account by account number and display the account info\ \\t\"
                         \"4. Make a Withdraw\ \\t\"
                         \"5. Make a Deposit \ \\t\"
                         \"6. Transfer money from one account to another\ \\t\"
                         \"7. List all accounts \ \\t\";
                 cout<<\"Choose the operation : \";
                 cin>>op;
                 switch(op){
                         case 1: addAccount();
                                 break;
                         case 2: deleteAccount();
                                 break;
                         case 3: searchAccount();
                                 break;
                         case 4: withdraw();
                                 break;
                         case 5: deposit();
                                 break;
                         case 6: transfer();
                                 break;
                         case 7: list();
                                 break;
                         default : cout<<\"Invalid operation \ \";
                                   exit(0);
                 }
                 cout<<\"Do you wants more operation (Y/y) by default No : \";
                 cin>>ch;
         }while(ch == \'Y\' || ch == \'y\');
 }




