Repository navigation
Conversions implemented in Java - #433
Closed
RishiPrakash wants to merge 1 commit into
Closed
RishiPrakash wants to merge 1 commit into
RishiPrakash wants to merge 1 commit into
Conversation
Closed
christianbender
requested changes
May 18, 2018
christianbender
left a comment
There was a problem hiding this comment.
Good Work! I have some requests.
| @@ -0,0 +1,101 @@ | |||
| public class IntToRoman { | |||
|
|
|||
| int value(int toPret){ | |||
There was a problem hiding this comment.
Please have a look on the code style conventions Between methods and { a space.
| intToRoman(a%toRepeat); | ||
| return str.toString(); | ||
|
|
||
| } |
| for(int i =0;i<(a/toRepeat);i++){ | ||
| str.append(corString); | ||
| } | ||
| if((a%toRepeat)>0) |
There was a problem hiding this comment.
Between if and (...) one space. See
| int intVal = 11128; | ||
| System.out.println(new IntToRoman().intToRoman(intVal)); | ||
|
|
||
| } |
There was a problem hiding this comment.
Please correct the indentation.
| return 0; | ||
| } | ||
| } | ||
| public int romanToInt(String a1) { |
| return total; | ||
| } | ||
|
|
||
| public static void main(String[] s){ |
christianbender
requested changes
May 18, 2018
| @@ -0,0 +1,101 @@ | |||
| public class IntToRoman { | |||
|
|
|||
| int value(int toPret){ | |||
There was a problem hiding this comment.
This methods you can write as static. Then you don't need the instanciate a object of type IntToRoman and you can use this method right away in you main method.
christianbender
requested changes
May 18, 2018
| return ""; | ||
| } | ||
|
|
||
| StringBuffer str = new StringBuffer(); |
There was a problem hiding this comment.
You don't need StringBuffer you can simply use String.
Author
|
@christianbender Okay Christian I will update my files and will let you know. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have added 2 files for Roman to Int and Int to Roman conversion.