COMP2243 - Programming and Problem Solving

Syllabus Software Installation Assignments Tests
Lectures and Labs
**Back to Full Menu**

Graphical User Interface Mile Per Gallon More Programs Road Sign Quiz



Road Sign JavaFX Program


Description

This program is a GUI program developed with JavaFX.

It is a quiz program to test the user's knowledge about road signs.

There are 12 images of road sign. Each time a random image is shown and the user selects the corresponding answer.

The program determines whether or not the answer is correct.

Associated Concepts:

GUI Programming with JavaFX

Algorithm:

Create an array to store 12 images.

Declare a variable called index

Start button event:

Generate a random index between 0 and 11

Load the image at the index to the quiz form

Submit button event:

Retrieve the index of the user's answer

If the image index is equal to the user answer's index

    Correct answer

Else

    Incorrect answer


Partially Completed Java Program and Images: RoadSignQuizStudent.zip



Source Code