fork download
  1. //Saliha Babar CS1A Chapter 4, Page 220, #1
  2. //
  3. /************************************************************************
  4.  *
  5.  * DISPLAY THE NUMERAL ROMAN
  6.  * ______________________________________________________________________
  7.  * This program displays the roman numeral of number from 1 to 10
  8.  *
  9.  * There's no specific formula for this program
  10.  *________________________________________________________________________
  11.  * INPUT
  12.  * numeralValue : number entered by user
  13.  *
  14.  * OUTPUT
  15.  * no specific output variables
  16.  * *********************************************************************/
  17. #include <iostream>
  18. using namespace std;
  19.  
  20. int main() {
  21.  
  22. int numeralValue; // INPUT - number entered by user
  23.  
  24. cout << "Enter any number from 1-10 then I will\n";
  25. cout << "convert it into roman version of it.\n";
  26. cin >> numeralValue;
  27.  
  28. switch (numeralValue)
  29. {
  30. case 1 : cout << "Roman value I\n";
  31. break;
  32.  
  33. case 2 : cout << "Roman value II\n";
  34. break;
  35.  
  36. case 3 : cout << "Roman value III\n";
  37. break;
  38.  
  39. case 4 : cout << "Roman value IV\n";
  40. break;
  41.  
  42. case 5 : cout << "Roman value V\n";
  43. break;
  44.  
  45. case 6 : cout << "Roman value VI\n";
  46. break;
  47.  
  48. case 7 : cout << "Roman value VII\n";
  49. break;
  50.  
  51. case 8 : cout << "Roman value VIII\n";
  52. break;
  53.  
  54. case 9 : cout << "Roman value IX\n";
  55. break;
  56.  
  57. case 10 : cout << "Roman value X\n";
  58. break;
  59.  
  60. default : cout << "Pls enter number from 0-10 only\n";
  61. }
  62.  
  63. return 0;
  64. }
Success #stdin #stdout 0.01s 5288KB
stdin
8
stdout
Enter any number from 1-10 then I will
convert it into roman version of it.
Roman value VIII