76 974
Assignments Done
Successfully Done
In June 2019

Answer to Question #20758 in C++ for ahamed

Question #20758
create aclass that imitates part of functionality of the basic data type int call the class int. the only data in this class is an int variable. include member functions to initialize an int to 0,to initialize it to an int value to display it and to add two int values

write aprogram that exercises this class by creating two initialized values and placing the response in the uninitialized value and then displaying this result

with flowchart and algorithm
Expert's answer
#include <iostream>
using namespace std;

class Int {
int k1,k2;

Int(int _k1, int _k2):k1(_k1),k2(_k2){};
void print();

void Int::print(){
cout<<k1<<" quot;<<k2;

int main(int argc, const char * argv[])
int k1,k2;
Int obj(k1,k2);

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions