Answer to Question #282670 in C++ for Roe

Question #282670

Create an array list.


Use class and call the basic functions in main


Note:no global declarations

1
Expert's answer
2021-12-28T01:31:19-0500
#include<iostream.h> 
class arraylist
{
    int a[6];
    public:
    void getelts()
    {
        cout<<”Enter 6 numbers in the array:”<<endl;
        for(int i=0;i<6;i++)
        {
            cin>>a[i];
        }
    }
    void show()
    {
        cout<<”\nArray elements are”<<endl;
        for(int i=0;i<6;i++)
        {
            cout<<a[i]<<endl;
        }
    }
};
void main()
{
    arraylist obj;
    obj.getelts();
    obj.show();
} 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog