//Max Kichuk CS1A Chapter 4, P.220, #2
/**********************************************************************
*
* ROMAN NUMERAL CONVERTER
* ____________________________________________________________________
* This program converts regular numbers into roman numerals.
* It only converts numbers between 1-10.
* ____________________________________________________________________
* INPUT
* user_number : Number being converted to a roman numeral
*
**********************************************************************/
#include <iostream>
using namespace std;
int main() {
int user_number; // INPUT: Number being converted to a roman numeral
// Ask the user to enter a number
cout << "Enter a number between 1 and 10" << endl;
cout << endl;
cin >> user_number;
// Check to see if the number is between 1-10
if (user_number >= 1 && user_number <= 10){
// Convert number to roman numerals
switch(user_number){
case 1: cout << "You entered the roman numeral I";
break;
case 2: cout << "You entered the roman numeral II";
break;
case 3: cout << "You entered the roman numeral III";
break;
case 4: cout << "You entered the roman numeral IV";
break;
case 5: cout << "You entered the roman numeral V";
break;
case 6: cout << "You entered the roman numeral VI";
break;
case 7: cout << "You entered the roman numeral VII";
break;
case 8: cout << "You entered the roman numeral VIII";
break;
case 9: cout << "You entered the roman numeral IX";
break;
case 10: cout << "You entered the roman numeral X";
break;
}
}
// Check if user entered invalid number
else{
cout << "You entered an invalid number" << endl;
cout << "Your number must be between 1-10";
}
return 0;
}