Question: Objectives: JavaFX ArrayList File I/O UML Diagrams Task: Quiz yourself with your own app! Winter ... (1 bookmark) Objectives: JavaFX ArrayList File I/O UML Diagrams

Objectives: JavaFX ArrayList File I/O UML Diagrams Task: Quiz yourself with your own app! Winter ...

(1 bookmark)

Objectives:

JavaFX

ArrayList

File I/O

UML Diagrams

Task: Quiz yourself with your own app!

Winter is coming! .....no, wait....Midterms...Midterms are coming! Write an app to help prepare. It'll ask a series of multiple-choice questions and give feedback about your answer.

Getting Started

To begin this lab, create a new JavaFX project named abc123-lab3, and create the following:

Main.java - in the application package

MainController.java - in the application.controller package

Quiz.java - in the application.model package

Main.fxml

This lab is your first hands-on experience with JavaFX on your own. It will follow the MVC design pattern (as all of our JavaFX apps this semester). There will be 1 model, 1 view, and 1 controller.

App Design

Your program will show a view similar to the one shown below when the app is run: Objectives: JavaFX ArrayList File I/O UML Diagrams Task: Quiz yourself with your This view will be the Main.fxml.

If the user chooses the correct answer, your app should showcase clearly that they have answered correctly. An example is provided here the white background becomes green and the correct answer is highlighted that the user chose. The user can then click the "Next Question" button to move on to another question.

If the user chooses an incorrect answer, your app should showcase clearly that they have answered incorrectly. An example is provided here where the background becomes red and the correct answer is highlighted, The user can then choose another answer and receive feedback, or choose the "Next Question" button to move on to the next question. You may customize your app how ever you choose - this includes images, fonts, colors, size of the app. The app must have a label for the app (should here as "My Study App"), one question shown at a time, and four clickable answers.

Making it Work

Main.java will launch the application and shown the Main.fxml. MainController.java will need to implement the EventHandler interface, and handle any events that occur when the user interacts with Main.fxml. When the app launches, the MainController will call on the Quiz class to provide a question and a set of answers to be displayed on Main.fxml. If the user answers correctly, MainController should modify Main.fxml to show positive feedback (green). Likewise, if the user answers incorrectly, the MainController should modify Main.fxml to show negative feedback (red).

Questions & Answers

Don't panic, you won't have to construct the quizzes for your application - they are provided for you here: quiz.csv Place this file at the top of your Eclipse project (drag and drop it into your project, select "copy files" if it asks). A sample of the data format is as follows: What type of language is Java?,Object-oriented,Functional,Mark-up,Klingon Which of the following is not a primitive type in Java?,String,int,float,boolean From this sample, you can see that each line is a separate question in your quiz. The file is a .csv file, so it is comma delimited, and should be parsed. The first token in the line is the question, and each subsequent token is an answer. The correct answer is always the first.

Quiz

Quiz.java will be the model of this application. The class must have variables to save questions (Strings) and answers (Strings) for the entire quiz - that is, all questions. This class should use at least one ArrayList. As the model, this class is responsible for reading data from the csv file provided, parsing that data, and storing it in its variables. Additionally, this class must have public methods which the MainController can call in order to access the data. The MainController should request one question at a time from the Quiz model, so that one question can be provided to the user at a time. The remaining design of the model of this app is up to you - you may add other model classes if you find it necessary.

Extra Credit

For full credit on this lab, you may implement the quiz following the format of the input data file - that is, the correct answer will always be answer A. For extra credit, shuffle the answers so that the correct answer can be either A, B, C, or D. If you opt for this, be sure to thoroughly test your application again, checking that correct and incorrect answers still show the appropriate responses.

here is the quiz.csv

What type of language is Java? Object-oriented Functional Mark-up Klingon
Which of the following is not a primitive type in Java? String int float boolean
Which SOLID design principle recommends that a class have only one job? SRP OCP LSP DIP
Who initially designed the Java programming language? James Gosling Ryan Gosling Ryan Reynolds Stan Lee
When was Java initially released? 1995 1990 1975 2000
What does JDK stand for? Java Development Kit Java Download Kit Java Developer Kids Just Don't Know

My Study App Which of the following is not a primitive type in Java? String int float boolean Next

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!