Institute of Computer Science
  1. Courses
  2. 2019/20 spring
  3. Object-Oriented Programming (Narva College) (LTAT.NR.003)
ET
Log in

Object-Oriented Programming (Narva College) 2019/20 spring

  • Home
  • Materials
  • Grading
  • Java Glossary
  • Cheat sheet (S1-S6)
  • Source Example
  • Links
Chapter 8

Tasks (to be submitted by 6.04)

Task 1. Lambda

Try the lambda expression in at least two different cases - different mouse events, different actions (e.g., color change, etc.). Submit the java file into Moodle.

Task 2. Button

Write a program that creates a window with a button. Add events so that when the mouse enters the button's region, the button "jumps away" from the mouse to a random place of the window. Ensure that the button does not jump out of the window (even after resizing the window).

Task 3. Test question

Write a program that asks a multi-choice question (with one or more correct answers) and provides a feedback. Depending on the choice (one or more correct answers), choose an appropriate user interface component to realize it. (The program should use graphical user interface, not the command line.)

Task 4. Tic-tac-toe

Run the tic-tac-toe program and study the code. Some things are commented, but not all of them. Try to understand the overall structure of the program and then study different parts of it: who is doing what.

Here are some guiding questions.

  • Which method is executed by the start method? What does this method do?
  • Which methods have been executed by the time the user can make moves on the stage?
  • Which parts does the application window consist of? Which JavaFX classes are used to achieve this?
  • How is the shape of the game board, the Xs and Os obtained? How can they be changed?
  • What method is fired by pressing the Start button? What does this method do?
  • ...

It's not necessary to write down anything at home (although, it is possible, of course). Understanding of the program is important. Be ready to answer these and some more extra questions during the session.

Chapter 8
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment