input only roman numerals

how do i program so that the user can only input roman Numerals(MXXL)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  
#include <iostream>
#include <string>
#include <cctype>
#include <iomanip>
using namespace std;

bool checker(string roman);



int main()
{
	string roman;
	char goAgain;
	int value;
	
do
{
	cout << "Please enter the Roman Numeral to convert : ";
	cin >> roman;
	
	bool checker(string roman);
 
 
 cout << "Roman Number " << roman << " equals " <<endl;
 cout << "Want to convert Roman NUmeral again(Y or N)";
 cin >> goAgain;

while(toupper(goAgain) !='Y' && toupper(goAgain) !='N')
{
  cout << "please enter Y or N: ";
  cin >> goAgain;
}
	
}while(toupper(goAgain) =='Y');

return 0;
}


bool checker(string roman)
{

   
}




A roman number can only be composed of the letters "IVXLCDM" (either majuscule or miniscule). So checker() should see if there are any letters except those in the string.

There is a special case: zero is represented either with "N" or "NULLA". You might get bonus points for checking if your string is equal to either of those.

Hope this helps.
sorry but this doesn't really help me
Topic archived. No new replies allowed.