id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

davereed@creighton.edu > numToRoman
prev  |  next  |  chance

numToRoman() -- You are to convert from a positive integer to a roman numeral equivalent(represented as a string of uppercase letters). Recall that the roman letters correspond to values as follows: 'M' = 1000, 'D' = 500, 'C' = 100, 'L' = 50, 'X' = 10, 'V' = 5, 'I' = 1. You may assume the ancient roman style of writing letters, where 4 is represented "IIII" and 90 is represented "LXXXX".


numToRoman(1) → "I"
numToRoman(8) → "VIII"
numToRoman(2017) → "MMXVII"

...Save, Compile, Run (ctrl-enter)

public String numToRoman(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy