Answer:
// In the number.cpp file;
#include "Number.h"
#include <iostream>
using namespace std;
Number::Number(int number)
{
num = number;
}
void Number::SetNum(int number)
{
num = number;
}
int Number::GetNum()
{
return num;
}
ostream &operator<<(ostream &out, const Number &n)
{
out << "The value is " << n.num << endl;
return out;
}
// in the main.cpp file;
#include "Number.cpp"
#include <iostream>
using namespace std;
int main()
{
int input;
cin >> input;
Number num = Number(input);
cout << num;
return 0;
}
Step-by-step explanation:
The main function in the main.cpp file prompts the user for the integer value to be displayed. The Number file contains defined functions and methods of the number class to set, get and display the "num" variable.