Lab1#46
Open
kalllegar wants to merge 1 commit into
Open
Conversation
Rrenkens
reviewed
Dec 21, 2022
| public class Main { | ||
| public static void main(String[] argv) { | ||
| Map<String, Quiz> givenQuizzes = getQuizMap(); | ||
| System.out.println("enter the name of the test:"); |
| } | ||
| } | ||
| Formatter formatter = new Formatter(); | ||
| formatter.format("%.1f", currentQuiz.getMark()); |
| //TextTest usage | ||
| TextTask firstTextTask = new TextTask("what the best array sorting asymptotics?", "O(nlogn)"); | ||
| TextTask secondTextTask = new TextTask("how many people are in our group?", "26"); | ||
| TextTask thirdTextTask = new TextTask("the asymptotics with which the insertion into the map is performed?", "O(1)"); |
| Task result = nextTask; | ||
| currentTask = nextTask; | ||
| if (taskCount > 1) { | ||
| nextTask = generator.generate(); |
Owner
There was a problem hiding this comment.
Почему нам необходимо хранить текущую и следующую таску?
| * @param tasks задания, которые передаются в конструктор в Collection (например, {@link LinkedList}) | ||
| */ | ||
| public PoolTaskGenerator(boolean allowDuplicate, Collection<Task> tasks) { | ||
| LinkedHashSet<String> unique = new LinkedHashSet<>(); |
Owner
There was a problem hiding this comment.
Зачем здесь LinkedHashSet? Почему обычный HashSet не подошел?
| this.minNumber = minNumber; | ||
| this.maxNumber = maxNumber; | ||
| this.operations = operations.clone(); | ||
| if (operations.equals(EnumSet.noneOf(MathTask.Operation.class))) { |
| .skip(pos) | ||
| .limit(1) | ||
| .findFirst() | ||
| .orElse(Operation.ADDITION); |
Owner
There was a problem hiding this comment.
Упасть на некорректных данных лучше, чем генерировать какие-то рандомные примеры, а еще лучше не упасть и сообщить об ошибке.
| text = "The accuracy of answer must be no less then " + getaccuracyAsDoubleValue() + "\n" + | ||
| "x" + Operation.toChar(operation) + firstNumber + "=" + secondNumber; | ||
| if (doubleEqual(firstNumber, 0.0) && operation == Operation.DIVISION) { | ||
| answer = "invalid operation"; |
Owner
There was a problem hiding this comment.
как я должен догадаться до такого ответа?
| if (doubleEqual(firstNumber, 0.0) && | ||
| doubleEqual(secondNumber, 0.0) && | ||
| operation == Operation.MULTIPLICATION) { | ||
| answer = "there is no right answer"; |
Owner
There was a problem hiding this comment.
И тут скорее лучше сказать, что все подходит
| super(firstNumber, secondNumber, accuracy, operation); | ||
| text = "The accuracy of the answer must be at least " + getaccuracyAsDoubleValue() + "\n" + | ||
| firstNumber + Operation.toChar(operation) + secondNumber + "=?"; | ||
| if (secondNumber == 0 && operation == Operation.DIVISION) { |
Owner
There was a problem hiding this comment.
Почему тут без epsilon сравнение?
Owner
|
Ну пока что такая оценка:
Допы:
В итоге 8.35, коэффициент 0.5 = 4.175. +5 за допы. Я подумаю, что делать с похожими работами. |
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.
No description provided.