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

 

andersoniii.edwin@cusd80.com > RomanCalculatorTwo
prev  |  next  |  chance

Friends, Romans, Countrymen lend me your ear. We will soon have a program which will allow us Romans to communicate with the barbarians by converting our numerals into their numbers and doing an operation! - Programmers please complete the code to receive TWO Roman numeral (strings)and an operator character (+,-,*,/, and %), combine these numbers, and return the Natural number answer. Please be advised that we will be concerned with changing "IV" into 4 example XIV + X will return 24. Note the largest Roman character is M for 1000. Choose the hint for the other values and characters. REMEMBER Romans are not negative and we have not learned decimal numerals (yet), BUT we do know NOT to divide by nothing (ZERO) -- SO we will never do that.


RomanCalculatorTwo("M", "M", "+") → 2000
RomanCalculatorTwo("MMMX", "C", "%") → 10
RomanCalculatorTwo("MMCD", "CM", "-") → 1500

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

public int RomanCalculatorTwo(String a, String b,char operator){ }

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

Difficulty: 198 Post-solution available

Copyright Nick Parlante 2017 - privacy