Conversation
Rework print to console.
| break; | ||
| } | ||
|
|
||
| System.out.println(arg + " : " + arg.length() + " letters"); |
There was a problem hiding this comment.
| System.out.println(arg + " : " + arg.length() + " letters"); | |
| System.out.println(arg + ": " + arg.length() + " letters"); |
| Scanner scanner = new Scanner(System.in); | ||
| String sizeAsString = scanner.nextLine(); | ||
| if (!isNumber(sizeAsString)) { | ||
| System.out.println("ERROR! This is not a number"); |
There was a problem hiding this comment.
check the output format in the task
| for (int i = 0; i < params.length; i++) { | ||
| params[i] = scanner.next(); | ||
| } | ||
| if (!isNumber(params[0]) || !isNumber(params[1])) { |
There was a problem hiding this comment.
move validate to a new separate method (validateParams, for example)
| params[i] = scanner.next(); | ||
| } | ||
| if (!isNumber(params[0]) || !isNumber(params[1])) { | ||
| System.out.println("ERROR! This is not a number"); |
There was a problem hiding this comment.
check the output format in the task
| } | ||
| String strategy = params[2]; | ||
| int strategyMod; | ||
| if (strategy.equals("even")) { |
There was a problem hiding this comment.
move to a new separate method (getResult, for example)
There was a problem hiding this comment.
Because your code is too complex and difficult to read
| Scanner scanner = new Scanner(System.in); | ||
| String secondsAsString = scanner.next(); | ||
| if (isNumber(secondsAsString)) { | ||
| System.out.println("ERROR! Seconds must be a number"); |
There was a problem hiding this comment.
check the output format in the task
|
|
||
| private final int age; | ||
|
|
||
| private final int high; |
There was a problem hiding this comment.
add new mutable class field
There was a problem hiding this comment.
I thought it's a requirement
| int size = Integer.parseInt(sizeAsString); | ||
| for (int i = 0; i < size; i++) { | ||
| for (int j = 0; j <= i; j++) { | ||
| System.out.print("*"); |
There was a problem hiding this comment.
I thought we're printing x...
| import java.util.Scanner; | ||
| import java.util.regex.Pattern; | ||
|
|
||
| public class PyramidPrinter { |
| if (isNumber(sizeAsString)) { | ||
| System.out.println(ERROR_MESSAGE); | ||
| return; | ||
| } |
| import java.util.Scanner; | ||
| import java.util.regex.Pattern; | ||
|
|
||
| public class RandomCharsTable { |
| for (int i = 0; i < params.length; i++) { | ||
| params[i] = scanner.next(); | ||
| } | ||
| if (isNumber(params[0]) || isNumber(params[1])) { |
| if (rows == 0 || columns == 0) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
It's not expected behaviour, according to chat
| public static final String ERROR_MESSAGE = "Only 1 non-negative integer is allowed as passed parameter"; | ||
| public static final String DAY_OVER = "The day is over"; | ||
|
|
||
| public void run() { |
There was a problem hiding this comment.
Here and in other places: i would recommend getting rid of multiple if/else statements and separate logic to other methods





No description provided.