Difference between revisions of "Rattlesnake 2"

From Grundy
Jump to navigation Jump to search
m
 
Line 1: Line 1:
<!-- <b>Date</b>: 8th October 2017
+
<b>Date</b>: 8th October 2017
  
<b>Youtube Problem Statement</b>:[https://www.youtube.com/watch?v=DrIOkmOVjzM https://www.youtube.com/watch?v=DrIOkmOVjzM] -->
+
<b>Youtube Problem Statement</b>:[https://www.youtube.com/watch?v=DrIOkmOVjzM https://www.youtube.com/watch?v=DrIOkmOVjzM]
  
 
<!--  <b>Youtube Solution:</b> [https://www.youtube.com/watch?v=f7Mt3-pUPss https://www.youtube.com/watch?v=f7Mt3-pUPss]
 
<!--  <b>Youtube Solution:</b> [https://www.youtube.com/watch?v=f7Mt3-pUPss https://www.youtube.com/watch?v=f7Mt3-pUPss]
  
 
<b>Solution upload link:</b> [https://codeboard.io/projects/39635 https://codeboard.io/projects/39635] -->
 
<b>Solution upload link:</b> [https://codeboard.io/projects/39635 https://codeboard.io/projects/39635] -->
<!--
+
 
 
== Problem Statement ==
 
== Problem Statement ==
 
Write a program in Python to convert a Roman numeral into its equivalent decimal number and vice-versa. The program should run in a loop and should continue asking the user if he wants to quit. If the user wants to continue, he should be prompted to choose whether to enter a Roman or Decimal number, and then asked to enter the number itself.
 
Write a program in Python to convert a Roman numeral into its equivalent decimal number and vice-versa. The program should run in a loop and should continue asking the user if he wants to quit. If the user wants to continue, he should be prompted to choose whether to enter a Roman or Decimal number, and then asked to enter the number itself.
Line 30: Line 30:
 
The Roman equivalent is CCXXXI <br>
 
The Roman equivalent is CCXXXI <br>
 
Do you want to try again? (Y/N) <br>
 
Do you want to try again? (Y/N) <br>
-N <br> -->
+
-N <br>  
  
 
<!-- == Solution ==
 
<!-- == Solution ==

Latest revision as of 12:57, 8 October 2017

Date: 8th October 2017

Youtube Problem Statement:https://www.youtube.com/watch?v=DrIOkmOVjzM


Problem Statement

Write a program in Python to convert a Roman numeral into its equivalent decimal number and vice-versa. The program should run in a loop and should continue asking the user if he wants to quit. If the user wants to continue, he should be prompted to choose whether to enter a Roman or Decimal number, and then asked to enter the number itself.

Input format: Input format isn't strict. However, you should follow the following sequence of prompts. First, the program should give a choice to enter a roman or decimal number. Then, the program should prompt to enter the number. After the correct answer is given, the program should sak the user whether to quit.

Output format: For each number, print its equivalent.

Example:

Enter R/A to enter the Roman/Arabic(decimal) number.
- R
Enter the number in Roman.
- XL
The decimal equivalent is 40
Do you want to try again? (Y/N)
- Y
Enter R/A to enter the Roman/Arabic(decimal) number.
-A
Enter the number in decimal.
-231
The Roman equivalent is CCXXXI
Do you want to try again? (Y/N)
-N


See also