#include<iostream>
#include "elements.h"
usingnamespace std;
int main( )
{
int StrgAmt;
int number;
Data bo[10];
cout<<"How many elements do you want? : "<<endl;
cin>>StrgAmt;
for(int i=0;i<StrgAmt;i++){
cout<<"Fill in the array: "<<endl;
cin>>number;
}
for(int j=0;j<StrgAmt;j++){
bo[j].setItem(number,StrgAmt);
cout<<bo[j].getItem();
}
return 0;
}
#ifndef _Data_BOX
#define _Data_BOX
// Set the type of data stored in the box
typedefdouble ItemType;
// Declaration for the class PlainBox
class Data
{
private:
// Data field
staticconstint Default_Size=10;
ItemType vStore[Default_Size];
int capacity;
int num_used;
public:
// Default constructor
Data ();
bool isFull();
bool isEmpty();
int arrayCapacity();
int numUsed(const ItemType& Entry);
Data (const ItemType& Entry);
void setItem (const ItemType& Entry, int num_used);
ItemType getItem () const;
int ADD(const ItemType& Entry);
int PosOfElem(const ItemType& Entry);
};
#endif
It still doesnt work, what im trying to do is add elements to an array using the set function, then printing them out using the get function but i keep getting the same exponent number every time i print out the array