+ 2

Application which is a psychological test

Hello, I'd like to build an application which is a psychological test. The test consists of 30 questions with 3 options of answers each. Could you please advise me what classes, objects and methods are best to achieve this objective. I have some ideas regarding this but since it's my first program I'd appreciate your opinions on this matter. ______ Доброго всем времени суток! Решила написать свою первую программу JAVA. Это будет психологический тест, 30 вопросов, по 3 варианта ответа на каждый. У меня есть свои идеи и представления, как это сделать, но была бы рада Вашим мнениям и советам, мыслям, о чем важно не забыть при написании кода, поскольку JAVA учу пока недолго и до сих пор были более простые вещи. ______ Thanks to everyone!

18th Aug 2018, 4:21 PM
Zoya Klocheva
Zoya Klocheva - avatar
2 Antworten
+ 2
class question, if you wanted to make it general you could just define basic characteristics such as question and answer and methods to get them and check answers, then you could subclass to multipleChoiceQuestion and define that class the way you want your question to be displayed and the possible answers, then a test class that can store an array or some other structure to hold the questions, as well as methods to add questions to the test and store how many answers were correct and how many were wrong, if you want to keep track of the people taking it, probably a person class that can hold the info you want, then its up to you whether the people contain a test object or if the test objects contain people with their info, the latter makes more sense to me as each test object would have a person associated with it.
19th Aug 2018, 1:20 PM
StealthyTaco
StealthyTaco - avatar
+ 1
Если это первая программа то я бы в первую очередь обратил внимание на название полей и методов в CamelCase. Методы должны быть понятными и выполнять только одну функцию, не стоит писать один метод который выполняет все задачи. Заюзал бы интерфейсы и наследовал классы от них, возможно ты захочешь сделать еще один тест, или поменять что то в этом тесте, это супер удобно. Советую разделить классы по своему назначению. Допустим: MockDBTest: отвечает за хранение всех твоих вопросов. Еще такие же классы должны отвечать за вывод на экран, саму обработку данных(логику приложения). Удачи в написании)
21st Aug 2018, 11:24 AM
Artem Muravlev
Artem Muravlev - avatar