Numbers to Roman Numerals

Write a program that does the following:

Asks the user to enter an integer
Prints the integer in Roman numerals
1.) Asks the user if they'd like to convert another integer
2.) If the user enters 'n' or 'N': end the program (return 0;)
3.) If the user enters anything else: go back to step 1


I don't really know what to do after and I don't really understand step 3. How do I structure this?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <string>

using namespace std;

int main(){

    string roman; 
    int integer; 
    int piece;   
 
cout << "Please enter an integer: ";
cin >> integer;




The output should look something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Please enter an integer: 123
--> CXXIII

Would you like to convert another integer (Y/N)? y

Please enter an integer: 401
--> CDI

Would you like to convert another integer (Y/N)? y

Please enter an integer: 1299
--> MCCXCIX

Would you like to convert another integer (Y/N)? n
Last edited on
Topic archived. No new replies allowed.