0

I have a C++ code of array of objects and I want to display it in the tablular form can anybody help regarding the code. What changes should I make to display the code in the tabular form.

#include<iostream>
    using namespace std;
    class Bank_customer
    {
        char name[50];
        char acc_t[50];
        int acc_no;
        float age;
        public : void getdata(void);
                 void putdata(void);
    };
    void Bank_customer::getdata()
    {
        cout<<"Enter name : ";
        cin>>name;
        cout<<"Enter age : ";
        cin>>age;
        cout<<"Account number : ";
        cin>>acc_no;
        cout<<"Account type : ";
        cin>>acc_t;
    }
    void Bank_customer::putdata()
    {
        cout<<"Name : "<<name<<"\n";
        cout<<"Age : "<<age<<"\n";
        cout<<"Account Number : "<<acc_no<<"\n";
        cout<<"Account Type : "<<acc_t<<"\n";
    }
    const int size=10;
    int main()
    {
        int i;
        Bank_customer acc_info[size];
        for(int i=0;i<size;i++)
        {
            cout<<"\n Details of the Bank Account Holder "<<i+1<<"\n";
            acc_info[i].getdata();
        }
        cout<<"\n";
        for(i=0;i<size;i++)
        {
            cout<<"\n Bank Account Holder"<<i+1<<"\n";
            acc_info[i].putdata();
        }
        cout<<"\n ";
           return 0;
    }
Botje
  • 21,384
  • 3
  • 27
  • 38

1 Answers1

0

Here is the link to the example code you can find similar example you want in below examples, hope might be useful

gurgen
  • 1
  • 1