This repository was archived by the owner on Oct 25, 2021. It is now read-only.
Open
Conversation
…nto feature/MargaritaSkorodnikova
…nto feature/MargaritaSkorodnikova
…nto feature/MargaritaSkorodnikova
completed the Immutable class task
…nto feature/MargaritaSkorodnikova
| static char getRandomChar(int min, int max) { | ||
| max -= min; | ||
| char randomCh = (char) ((int) (Math.random() * ++max) + min); | ||
| return randomCh; |
Collaborator
There was a problem hiding this comment.
this method is too confusing and not correct.
- max - min = delta (not max!!!)
- (Math.random() * ++max - Why the incrimination?
|
|
||
| private boolean isValid(String input) { | ||
| return (input.matches("\\d+\\s\\d+\\sodd") || input.matches("\\d+\\s\\d+\\seven") | ||
| && height >= 0 && length >= 0); |
Collaborator
There was a problem hiding this comment.
&& height >= 0 && length >= 0 ??????
verification is not correct.
height and length - set after verification. What is checked before?
height and length cannot be 0. (replace - \d+ ->>> [1-9]\d* or [1-9][0-9]*)
| for (char[] ch : rCT) { | ||
| buildTable.append("| "); | ||
| for (char c : ch) { | ||
| buildTable.append(c).append(" | "); |
Collaborator
There was a problem hiding this comment.
Error! Space at the end of the line!
this will return:
|\\sA\\s|\\s
| } catch (IOException e) { | ||
| e.printStackTrace(); | ||
| } catch (NumberFormatException e) { | ||
| System.out.println("Input does not contain numbers"); |
Collaborator
There was a problem hiding this comment.
output - Only 1 non-negative integer is allowed as passed parameter!
| throw new IllegalArgumentException("Error. You can't enter negative numbers"); | ||
|
|
||
| } else if (input > END_OF_THE_DAY) { | ||
| throw new IllegalArgumentException("Error. The day has come to an end"); |
Collaborator
There was a problem hiding this comment.
output - Only 1 non-negative integer is allowed as passed parameter
…nto feature/MargaritaSkorodnikova
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Dear colleagues, please have a look at HW2. TIA