76 412
Assignments Done
Successfully Done
In May 2019

Answer to Question #22966 in C++ for Anna

Question #22966
Use integer (or floating-point) to represent the private data of the class. Provide a constructor function that enables an object of this class to be initialized when it is declared. The constructor should contain default values in case no initial values are provided. Provide public member functions for each of the following:
Expert's answer
#include <conio.h>
#include <iostream>

using namespace std;

class Foo
int data;

Foo(int data = 0)
this->data = data;

void main()
Foo bar();
Foo bar_2(8);

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