Answer to Question #259729 in C++ for zain

Question #259729

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.

 

1
Expert's answer
2021-11-01T18:49:10-0400
//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;
} 

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
APPROVED BY CLIENTS