Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Feature/margarita skorodnikova#53

Open
Margareeta wants to merge 30 commits intomasterfrom
feature/MargaritaSkorodnikova
Open

Feature/margarita skorodnikova#53
Margareeta wants to merge 30 commits intomasterfrom
feature/MargaritaSkorodnikova

Conversation

@Margareeta
Copy link
Collaborator

Dear colleagues, please have a look at HW2. TIA

Margareeta and others added 27 commits July 12, 2021 19:24
completed the Immutable class task
static char getRandomChar(int min, int max) {
max -= min;
char randomCh = (char) ((int) (Math.random() * ++max) + min);
return randomCh;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is too confusing and not correct.

  1. max - min = delta (not max!!!)
  2. (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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& 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(" | ");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output - Only 1 non-negative integer is allowed as passed parameter

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants