54 2 209KB
10/14/21, 12:28 AM
Self-Quiz Unit 6: Attempt review
Dashboard / My courses / CS 1102 - AY2022-T1 / 7 October - 13 October / Self-Quiz Unit 6
Started on Wednesday, 13 October 2021, 1:50 PM State Finished Completed on Wednesday, 13 October 2021, 1:57 PM Time taken 7 mins 35 secs Marks 5.00/5.00 Grade 100.00 out of 100.00
https://my.uopeople.edu/mod/quiz/review.php?attempt=5810117&cmid=265370
1/6
10/14/21, 12:28 AM
Self-Quiz Unit 6: Attempt review
Question 1 Correct Mark 1.00 out of 1.00
Consider the following Java program. Which statement registers an object to receive events? import javafx.application.Application; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.application.Platform; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.control.Button; public class TestFX extends Application { public void start(Stage stage) { Button quitButton = new Button("Quit"); quitButton.setOnAction(e -> Platform.exit()); HBox buttonBar = new HBox(quitButton); BorderPane root = new BorderPane(); root.setBottom(buttonBar); Scene scene = new Scene(root, 100, 50); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); } }
Select one: a.
import javafx.scene.control.Button;
b. Button quitButton = new Button("Quit"); c.
quitButton.setOnAction(e -> Platform.exit());
d. root.setBottom(buttonBar); e.
stage.setScene(scene);
Your answer is correct. See Section 6.3.1.
https://my.uopeople.edu/mod/quiz/review.php?attempt=5810117&cmid=265370
2/6
10/14/21, 12:28 AM
Self-Quiz Unit 6: Attempt review
Question 2 Correct Mark 1.00 out of 1.00
Consider the following Java program. Which one of the following is a package?
import javafx.application.Application; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.application.Platform; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.control.Button; public class TestFX extends Application { public void start(Stage stage) { Button quitButton = new Button("Quit"); quitButton.setOnAction(e -> Platform.exit()); HBox buttonBar = new HBox(quitButton); BorderPane root = new BorderPane(); root.setBottom(buttonBar); Scene scene = new Scene(root, 100, 50); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); } }
Select one: a.
javafx.scene.Scene
b. start c.
Stage
d. Button e.
BorderPane
Your answer is correct. See Section 4.6.2.
https://my.uopeople.edu/mod/quiz/review.php?attempt=5810117&cmid=265370
3/6
10/14/21, 12:28 AM
Self-Quiz Unit 6: Attempt review
Question 3 Correct Mark 1.00 out of 1.00
A class that implements a listener interface does which of the following?
Select one: a.
It generates events.
b. It handles events. c.
It maintains an object directory.
d. It records audio. e.
It runs an event loop.
Your answer is correct. See Section 6.3.1.
Question 4 Correct Mark 1.00 out of 1.00
Which one of the following is an event handler?
Select one: a.
an event generator
b. an event listener c.
an event loop
d. an event method e.
javafx.scene.input.MouseEvent;
Your answer is correct. See Section 6.3.1.
https://my.uopeople.edu/mod/quiz/review.php?attempt=5810117&cmid=265370
4/6
10/14/21, 12:28 AM
Self-Quiz Unit 6: Attempt review
Question 5 Correct Mark 1.00 out of 1.00
Consider the following Java program. Which line gives the "TestFX" class access to the "Button" class definition? import javafx.application.Application; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.application.Platform; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.control.Button; public class TestFX extends Application { public void start(Stage stage) { Button quitButton = new Button("Quit"); quitButton.setOnAction(e -> Platform.exit()); HBox buttonBar = new HBox(quitButton); BorderPane root = new BorderPane(); root.setBottom(buttonBar); Scene scene = new Scene(root, 100, 50); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); } }
Select one: a.
Button quitButton = new Button("Quit");
b. import javafx.application.Application; c.
import javafx.scene.control.Button;
d. root.setBottom(buttonBar); e.
public class TestFX extends Application
Your answer is correct. See Section 6.3.1
https://my.uopeople.edu/mod/quiz/review.php?attempt=5810117&cmid=265370
5/6
10/14/21, 12:28 AM
Self-Quiz Unit 6: Attempt review
◄ Learning Journal Unit 6 Jump to... Graded Quiz Unit 6 ►
https://my.uopeople.edu/mod/quiz/review.php?attempt=5810117&cmid=265370
6/6