<commit_before>#include<iostream>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;


void newAccount();
void editAccount(int, string);

void admin(int, string);
void client(int, string);

char name[256];

int main() {

    //Welcome Screen
    cout << "Hello and Welcome to E- Manager" << endl;
    cout << "Please enter your name below" << endl;

    //Inputting user's name to greet the user.

    cin.getline (name,256);
    cout << "Good day to you, " << name << endl;
    printf("\n");

    //Start banking functions
    again:
    cout << "Enter any of the numbers go ahead" << endl;
    cout << "What would you like to do from the following options:" << endl;
    cout << "1. Create new account" << endl;
    cout << "2. Edit existing account" << endl;
    cout << "3. Exit" << endl;

    //Choose options
    int choice;
    int accnum;
    string pswd;
    cin >> choice;
    printf("\n");

    //Use of switch for any one of the options
    switch(choice) {

        //Case to create new account
        case 1:
            newAccount();
            break;


        //Case to edit existing account
        case 2:
            cout << "Enter the account number: " << endl;
            cin >> accnum;

            //Default account number set up.
            if(accnum == 123456) {
                wrongpswd:
                cout << "Enter your account's password" << endl;
                cin >> pswd;
                if (pswd == "<PASSWORD>") {
                    printf("\n");
                    editAccount(accnum,pswd);
                    }
                else {
                    cout << "Wrong Password entered" << endl;
                    cout << "Try again" << endl;
                    printf("\n");
                    goto wrongpswd;
                    }
                }

            //In case account number doesn't match with the file
            else {
                cout << "Account not found. Create a new account" << endl;
                goto again;
                }
            break;

        //Case to exit the program
        case 3:
            exit(0);

        //In case none of the options are entered
        default:
            cout << "Enter an appropriate choice" << endl;
            goto again;
    }

    return 0;
}

//Function to add new account
void newAccount() {

}<commit_msg>Update main.cpp<commit_after>#include<iostream>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;

class acc
{       long int accnum1;
        string pswd1;
        int cash1;
    public:
        void get_data();
        void display_data(); //only for debugging
}n;


void acc::get_data()
{

        cout<<"Enter cash to deposit initially (min 500):";
        cin>>cash1;
        cout<<"Enter your account password:";
        cin>>pswd1;

        //Generating account no
        ifstream f;
        f.open("Acc_no.txt",ios::in);
        int i;
        f>>accnum1;
        accnum1++;
        f.close();

        ofstream f1;
        f1.open("Acc_no.txt",ios::out);
        f1<<accnum1;
        f1.close();

        cout<<"Account no generated:"<<accnum1<<endl;

        cout<<"Account created successfully";
}

void acc::display_data()
{
    ifstream f2;
    f2.open("bankaccounts.txt",ios::in);

    while(f2.read((char*)&n,sizeof(n)))
    {   //f2.read((char*)&n,sizeof(n));
        cout<<endl<<"Account number:"<<n.accnum1<<" ";
        cout<<"Cash in account:"<<n.cash1;
    }
    f2.close();

}

void newAccount();
void editAccount(int, string);

void admin(int, string);
void client(int, string);

char name[256];

int main() {

    //Welcome Screen
    cout << "Hello and Welcome to E- Manager" << endl;
    cout << "Please enter your name below" << endl;

    //Inputting user's name to greet the user.

    cin.getline (name,256);
    cout << "Good day to you, " << name << endl;
    printf("\n");

    //Start banking functions
    again:
    cout << "Enter any of the numbers go ahead" << endl;
    cout << "What would you like to do from the following options:" << endl;
    cout << "1. Create new account" << endl;
    cout << "2. Edit existing account" << endl;
    cout << "3. Exit" << endl;

    //Choose options
    int choice;
    int accnum;
    string pswd;
    cin >> choice;
    printf("\n");

    //Use of switch for any one of the options
    switch(choice) {

        //Case to create new account
        case 1:
            newAccount();
            break;


        //Case to edit existing account
        case 2:
            cout << "Enter the account number: " << endl;
            cin >> accnum;

            //Default account number set up.
            if(accnum == 123456) {
                wrongpswd:
                cout << "Enter your account's password" << endl;
                cin >> pswd;
                if (pswd == "<PASSWORD>") {
                    printf("\n");
                    editAccount(accnum,pswd);
                    }
                else {
                    cout << "Wrong Password entered" << endl;
                    cout << "Try again" << endl;
                    printf("\n");
                    goto wrongpswd;
                    }
                }

            //In case account number doesn't match with the file
            else {
                cout << "Account not found. Create a new account" << endl;
                goto again;
                }
            break;

        //Case to exit the program
        case 3:
            exit(0);

        //In case none of the options are entered
        default:
            cout << "Enter an appropriate choice" << endl;
            goto again;
    }

    return 0;
}

//Function to add new account
void newAccount() 
{       
        cout<<"*** Welcome to new account creation ***";
        n.get_data();
        ofstream f;
        f.open("bankaccounts.txt",ios::app);
        f.write((char*)&n,sizeof(n));
        f.close();
        n.display_data(); //Only for debugging

}
{'fraction_non_alphanumeric': 0.1255188444296862, 'fraction_numerical': 0.01045990370247385, 'mean_word_length': 1.606663781912592, 'pattern_counts': {'":': 0, '<': 159, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5470429', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1667, 'n_words': 551}