Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch (keypressed) {
- case keypressed:
- // something to do
- break;
- case keypressed:
- // something to do
- break;
- }
- public class QAClass {
- public String question;
- public String answer;
- public QAClass(String question) {
- this.question = question;
- }
- public void getQuestion() {
- System.out.print(this.question);
- }
- public void setAnswer() {
- this.answer = scanner.nextLine();
- }
- @Override
- public String toString() {
- return this.question + " " + answer;
- }
- }
- private LinkedList<QAClass> createQuestionList() {
- LinkedList<QAClass> list = new LinkedList<>();
- list.add(new QAClass("Podaj imie pracownika: "));
- list.add(new QAClass("Podaj wiek pracownika: "));
- return list;
- }
- private LinkedList<QAClass> askAllQuestionsToUser() {
- for(QAClass qa: questionsList) {
- qa.getQuestion();
- qa.setAnwer();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement