write a program Construct an ADT (any of your choice but make it unique) with appropriate data members and member functions (CRUD for now). Your implementation will be purely abstraction based i.e. you will make separate files for header, implementation and driver class. In your driver class you will have a list corresponding to the ADT. You will test your program for all list operations. show complete output in screen.
//file1 Interger.h
class Interger
{
private:
int N;
public:
Interger(int n);
int getInterger();
};
//file2 Interger.cpp
#include "Interger.h"
Interger::Interger() : N(0) { }
Interger::Interger(int n): N(n) {}
int Interger::getInterger()
{
return N;
}
//file3 main.cpp
//driver class
#include <iostream>
#include "Interger.h"
using namespace std;
int main()
{
Interger n(20);
cout << n.getInterger() << endl;
return 0;
}
Comments
Leave a comment