Deck 4: Introduction to Graphical Applications

ملء الشاشة (f)
exit full mode
سؤال
Which of the following statements is true?

A) Application class is the superclass, and ShellGraphicsApplication is the subclass.
B) ShellGraphicsApplication is the superclass, and the Application is the subclass.
C) ShellGraphicsApplication is the superclass, and main is the subclass.
D) None of these is correct.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The stroke and fill methods draw the figures in the ____________ colors.

A) main
B) prominent
C) foreground
D) background
سؤال
Graphical applications require a _________ method, which contains the code to execute when the application begins.

A) main
B) paint
C) draw
D) Graphics
سؤال
What is the likely cause if a figure is not visible inside a window?

A) The figure's coordinates are outside the bounds of the window.
B) At least one of the (x, y) coordinates is not valid.
C) The paint method was used.
D) The constructor requires a larger window.
سؤال
Gray consists of equal amounts of black and white.
سؤال
A(n) ___________ line is drawn if the startX and endX values are the same.
سؤال
The ______________ class provides the functionality for drawing shapes.

A) IntegerObject
B) paint
C) main
D) GraphicsContext
سؤال
A JavaFX graphical application opens a new window.
سؤال
When using the Color class, you can instantiate 16,000 additional combinations of the component values.
سؤال
The coordinate of the top left corner of the window is (0, 0).
سؤال
Which of the following is the purpose of the fill methods?

A) Render solid figures
B) Render the outline of the figure
C) Draw a rectangle in the background color
D) None of these is correct.
سؤال
JavaFX's GraphicsContex class, in the javafx.scene.canvas package, provides methods to draw figures such as rectangles, circles, and lines; to set the colors for drawing; and to write text in a window.
سؤال
fillRect( double x, double y, double width, double height ) draws a solid rectangle with its top-left corner at (x, y), with the specified width and height in pixels, and returns an int.
سؤال
It is more difficult to draw an octagon than a circle.
سؤال
When drawing a figure, it is useful to specify coordinates as offsets from a starting (x, y) coordinate.
سؤال
What would happens if the (x,y) coordinate you specify for a figure is not inside the window?

A) If a figure's coordinates are outside the bounds of the window, an error will be generated but the figure will be visible.
B) If a figure's coordinates are outside the bounds of the window, an error will be generated and the figure will not be visible.
C) If a figure's coordinates are outside the bounds of the window, no error will be generated, but some of the figure may not be visible.
D) None of these is correct.
سؤال
When drawing a square blue box crisscrossed with a yellow ribbon, you would draw the blue box before the yellow ribbon.
سؤال
An applet viewer, which is provided as part of the Java SE Development Kit (JDK), is a minimal browser that enables us to view the applet without needing to open a web browser.
سؤال
In Java, the __________ keyword specifies that one class is an extension of another and inherits the properties of the other class.

A) application
B) main
C) extends
D) elaborate
سؤال
Which package is the GraphicsContext class part of?

A) javax.swing
B) javafx.swing
C) java.awt
D) javax.awt
E) javafx.scene.canvas
سؤال
Calling the launch method in main automatically triggers a call to the ______ method.

A) init
B) main
C) start
D) exit
E) launch
سؤال
Where is the (0, 0) coordinate in the window?

A) Top left
B) Top right
C) Bottom left
D) Bottom right
سؤال
In horizontal lines, the startX and endX values are the same.
سؤال
strokeOval draws a solid oval.
سؤال
In JavaFX, we draw shapes and text on a(n) ________.
سؤال
If we want to draw a string in a specific font, we can change the font by calling the ________ method.
سؤال
The name of the method you would call to draw a solid square is __________.
سؤال
The name of the method you would call to display a String is __________ and fillText.
سؤال
The name of the method you would call to draw a solid oval is __________.
سؤال
The name of the method you would call to add a line to a polygon is __________.
سؤال
In the method strokeRect( 10, 20, 100, 200 ), 100 and 200 represent __________, respectively, of the rectangle being drawn.

A) the x and y coordinates of the top left corner
B) the x and y coordinates of the bottom right corner
C) the x and y coordinates of the top right corner
D) the width and height
E) the height and the width
سؤال
In the method call strokeRect( 10, 20, 100, 200 ), 10 and 20 represent, __________, respectively, of the rectangle being drawn.

A) the x and y coordinates of the top left corner
B) the x and y coordinates of the bottom right corner
C) the x and y coordinates of the top right corner
D) the width and the height
E) the height and the width
سؤال
The RGB values of Color.GREEN are:

A) 0,128,0.
B) 255,0,0.
C) 0,0,255.
D) 0,0,0.
E) 255,255,255.
سؤال
The RGB values of Color.ORANGE are:

A) 255,0,0.
B) 255,165,0.
C) 255,0,165.
D) 0,0,0.
E) 255,255,165.
سؤال
Using the Color static method rgb( int rr, int gg, int bb ), how many color combinations can you instantiate?

A) 255
B) 380
C) Around 1,000
D) Around 65,000
E) Around 16.7 million
سؤال
JavaFX is the most recent system for building graphical applications using Java.
سؤال
In JavaFX, the stroke and fill colors must always be the same.
سؤال
In JavaFX, once we have set the fill color, we can no longer change it.
سؤال
The strokeLine, strokeRect, and strokeOval methods are all void methods.
سؤال
The strokeText method is a value-returning method.
سؤال
The Color class contains Color constants.
سؤال
Black has RGB values (0, 0, 0).
سؤال
JavaFX uses a mixed performance/art metaphor. We start with a(n) __________ and add one or more scenes to it.
سؤال
To produce graphical output with JavaFX, we draw shapes and text on a(n) __________.
سؤال
In JavaFX, the name of the class that contains methods we can use to draw shapes is __________.
سؤال
The current stroke and fill colors are also called the __________ colors.
سؤال
The names of the methods used to set the current stroke color and current fill color are __________ and setFill, respectively.
سؤال
RGB stands for __________.
سؤال
Compare and contrast standard and graphical applications.
سؤال
How can you draw shapes made of straight lines that are not rectangles?
سؤال
CORAL is a constant of the Color class. How do we use it in a program?
سؤال
How is the strokeOval( double x, double y, double width, double height ) method related to graphical output?
سؤال
Estimate where the point (289, 240) would fall in a rectangle, 300 pixels wide by 250 pixels high.
سؤال
Can a method call using strokeOval( double x, double y, double width, double height ) be used in an expression?
سؤال
How is the clearRect( double x, double y, double width, double height ) method related to graphical output?
سؤال
Identify the programming line needed to print "Roses are red, violets are blue" twice on two different lines if the first line is gc.strokeText( "Roses are red", 140, 100 );.
سؤال
Why do you need to imagine a rectangle bounding all sides of the oval or circle in order to draw the figure?
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/57
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 4: Introduction to Graphical Applications
1
Which of the following statements is true?

A) Application class is the superclass, and ShellGraphicsApplication is the subclass.
B) ShellGraphicsApplication is the superclass, and the Application is the subclass.
C) ShellGraphicsApplication is the superclass, and main is the subclass.
D) None of these is correct.
A
2
The stroke and fill methods draw the figures in the ____________ colors.

A) main
B) prominent
C) foreground
D) background
C
3
Graphical applications require a _________ method, which contains the code to execute when the application begins.

A) main
B) paint
C) draw
D) Graphics
A
4
What is the likely cause if a figure is not visible inside a window?

A) The figure's coordinates are outside the bounds of the window.
B) At least one of the (x, y) coordinates is not valid.
C) The paint method was used.
D) The constructor requires a larger window.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
5
Gray consists of equal amounts of black and white.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
6
A(n) ___________ line is drawn if the startX and endX values are the same.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
7
The ______________ class provides the functionality for drawing shapes.

A) IntegerObject
B) paint
C) main
D) GraphicsContext
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
8
A JavaFX graphical application opens a new window.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
9
When using the Color class, you can instantiate 16,000 additional combinations of the component values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
10
The coordinate of the top left corner of the window is (0, 0).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following is the purpose of the fill methods?

A) Render solid figures
B) Render the outline of the figure
C) Draw a rectangle in the background color
D) None of these is correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
12
JavaFX's GraphicsContex class, in the javafx.scene.canvas package, provides methods to draw figures such as rectangles, circles, and lines; to set the colors for drawing; and to write text in a window.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
13
fillRect( double x, double y, double width, double height ) draws a solid rectangle with its top-left corner at (x, y), with the specified width and height in pixels, and returns an int.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
14
It is more difficult to draw an octagon than a circle.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
15
When drawing a figure, it is useful to specify coordinates as offsets from a starting (x, y) coordinate.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
16
What would happens if the (x,y) coordinate you specify for a figure is not inside the window?

A) If a figure's coordinates are outside the bounds of the window, an error will be generated but the figure will be visible.
B) If a figure's coordinates are outside the bounds of the window, an error will be generated and the figure will not be visible.
C) If a figure's coordinates are outside the bounds of the window, no error will be generated, but some of the figure may not be visible.
D) None of these is correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
17
When drawing a square blue box crisscrossed with a yellow ribbon, you would draw the blue box before the yellow ribbon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
18
An applet viewer, which is provided as part of the Java SE Development Kit (JDK), is a minimal browser that enables us to view the applet without needing to open a web browser.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
19
In Java, the __________ keyword specifies that one class is an extension of another and inherits the properties of the other class.

A) application
B) main
C) extends
D) elaborate
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which package is the GraphicsContext class part of?

A) javax.swing
B) javafx.swing
C) java.awt
D) javax.awt
E) javafx.scene.canvas
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
21
Calling the launch method in main automatically triggers a call to the ______ method.

A) init
B) main
C) start
D) exit
E) launch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
22
Where is the (0, 0) coordinate in the window?

A) Top left
B) Top right
C) Bottom left
D) Bottom right
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
23
In horizontal lines, the startX and endX values are the same.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
24
strokeOval draws a solid oval.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
25
In JavaFX, we draw shapes and text on a(n) ________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
26
If we want to draw a string in a specific font, we can change the font by calling the ________ method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
27
The name of the method you would call to draw a solid square is __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
28
The name of the method you would call to display a String is __________ and fillText.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
29
The name of the method you would call to draw a solid oval is __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
30
The name of the method you would call to add a line to a polygon is __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
31
In the method strokeRect( 10, 20, 100, 200 ), 100 and 200 represent __________, respectively, of the rectangle being drawn.

A) the x and y coordinates of the top left corner
B) the x and y coordinates of the bottom right corner
C) the x and y coordinates of the top right corner
D) the width and height
E) the height and the width
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
32
In the method call strokeRect( 10, 20, 100, 200 ), 10 and 20 represent, __________, respectively, of the rectangle being drawn.

A) the x and y coordinates of the top left corner
B) the x and y coordinates of the bottom right corner
C) the x and y coordinates of the top right corner
D) the width and the height
E) the height and the width
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
33
The RGB values of Color.GREEN are:

A) 0,128,0.
B) 255,0,0.
C) 0,0,255.
D) 0,0,0.
E) 255,255,255.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
34
The RGB values of Color.ORANGE are:

A) 255,0,0.
B) 255,165,0.
C) 255,0,165.
D) 0,0,0.
E) 255,255,165.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
35
Using the Color static method rgb( int rr, int gg, int bb ), how many color combinations can you instantiate?

A) 255
B) 380
C) Around 1,000
D) Around 65,000
E) Around 16.7 million
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
36
JavaFX is the most recent system for building graphical applications using Java.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
37
In JavaFX, the stroke and fill colors must always be the same.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
38
In JavaFX, once we have set the fill color, we can no longer change it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
39
The strokeLine, strokeRect, and strokeOval methods are all void methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
40
The strokeText method is a value-returning method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
41
The Color class contains Color constants.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
42
Black has RGB values (0, 0, 0).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
43
JavaFX uses a mixed performance/art metaphor. We start with a(n) __________ and add one or more scenes to it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
44
To produce graphical output with JavaFX, we draw shapes and text on a(n) __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
45
In JavaFX, the name of the class that contains methods we can use to draw shapes is __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
46
The current stroke and fill colors are also called the __________ colors.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
47
The names of the methods used to set the current stroke color and current fill color are __________ and setFill, respectively.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
48
RGB stands for __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
49
Compare and contrast standard and graphical applications.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
50
How can you draw shapes made of straight lines that are not rectangles?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
51
CORAL is a constant of the Color class. How do we use it in a program?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
52
How is the strokeOval( double x, double y, double width, double height ) method related to graphical output?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
53
Estimate where the point (289, 240) would fall in a rectangle, 300 pixels wide by 250 pixels high.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
54
Can a method call using strokeOval( double x, double y, double width, double height ) be used in an expression?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
55
How is the clearRect( double x, double y, double width, double height ) method related to graphical output?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
56
Identify the programming line needed to print "Roses are red, violets are blue" twice on two different lines if the first line is gc.strokeText( "Roses are red", 140, 100 );.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
57
Why do you need to imagine a rectangle bounding all sides of the oval or circle in order to draw the figure?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.