The assignment I need to complete is as follows:
Use the Numbers Class created for In Class Exercise Three to DERIVE a new
class RomanNumerals. RomanNumerals should provide the Roman Numeral
equivalent of a number entered, in the same fashion as Numbers. However, the
range on RomanNumerals is limited to One to Ten.
I have already completed the Numbers problem which was converting a number 0-9999 to the English translation of the number.
Number problem Code:
HEADER FILE//
#include <iostream>
#include <string>
using namespace std;
#include <iostream>
#include <string>
#include "Numbers.h"
using namespace std;
int main()
{
int Num;
cout << "This program displays the English description of a number.\n"
<< "Enter a number in the range 0 through 9999: ";
cin >> Num;
Numbers Obj(Num);
Obj.print();
system("PAUSE");
return 0;
}
I'm not really sure where to go from here, so if anyone can help me out it would be greatly appreciated.
Why does your Numbers class contains a static string Romannum? Surely that's what the derived class is all about?
I think your derived class needs to override one function; print.
That's it. That's all it needs to do, I think. The new print function just takes the number, checks it's between zero and ten, and outputs the roman numeral value.