Deck 6: Graphical User Interface GUI and Object-Oriented Design OOD
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
العب
ملء الشاشة (f)
Deck 6: Graphical User Interface GUI and Object-Oriented Design OOD
1
If lengthTF is a JTextField and pane is a container, then the statement pane.add(lengthTF); adds the text field to the content pane of a window.
True
2
Whenever there is a superclass-subclass relationship, the superclass inherits all data members and methods of the subclass.
False
3
Every window has a title, width, and height.
True
4
The class Container is included in the package java.awt.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
The class JFrame contains the method setSize.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
The GridLayout manager arranges GUI components in a list formation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
In object-oriented design, the nouns found in the problem specification can be used to select the operations in the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
The height and width of a window are measured in inches.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
In Java, data members are also known as fields.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
In Java, extends is a reserved word.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
The method getContentPane of the class JFrame is used to access the content pane of the window.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
When you click a JButton, an event, known as an action event, is created.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
GUI components are placed in a window called JFrame.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
The first step in solving a problem using object-oriented design is to identify objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
JTextFields are used to get input, but not show output.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
An interface is a class that contains only the method headings and each method heading is terminated with a semicolon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
The method addWindowListener is included in the class JFrame.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
In object-oriented design, the verbs in the problem specification can be used to identify the objects in the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
The class ActionListener contains only one method, actionEvent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
In Java, there is one way to make an application program create a window.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
To create a window, which of the following classes has to be extended?
A) Container
B) JFrame
C) JButton
D) JTextField
A) Container
B) JFrame
C) JButton
D) JTextField
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which of the following is NOT found within the content pane?
A) labels
B) title bar
C) text areas
D) buttons
A) labels
B) title bar
C) text areas
D) buttons
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
To display a window, you must invoke the method ____.
A) displayWindow
B) show
C) setVisible
D) setDisplay
A) displayWindow
B) show
C) setVisible
D) setDisplay
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following is NOT a required attribute of a window?
A) title
B) width
C) height
D) color
A) title
B) width
C) height
D) color
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of the following sets the window width to 100 pixels and the height to 200 pixels?
A) setSize(100, 200);
B) setSize(200, 100);
C) setDims(100, 200);
D) set(200, 100);
A) setSize(100, 200);
B) setSize(200, 100);
C) setDims(100, 200);
D) set(200, 100);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) ____ and Rectangle is a(n) ____.Which word goes in the first blank in the sentence above?
A) subclass
B) superclass
C) inherited class
D) package
A) subclass
B) superclass
C) inherited class
D) package
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
To determine whether two reference variables of the Integer type point to the same Integer object, we can use either the method equals of the class Integer or the operator ==.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which of the following methods is NOT part of the class JFrame?
A) setVisible
B) setSize
C) setTitle
D) getText
A) setVisible
B) setSize
C) setTitle
D) getText
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
Which of the following from the window above is a JButton?
A) Calculate
B) Exit
C) Both Calculate and Exit
D) Perimeter
A) Calculate
B) Exit
C) Both Calculate and Exit
D) Perimeter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
The Java class that you use to create windows is ____.
A) JTextField
B) JFrame
C) JButton
D) JLabel
A) JTextField
B) JFrame
C) JButton
D) JLabel
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
Wrapper class objects are mutable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which of the following is a reserved word in Java?
A) extends
B) pane
C) event
D) inheritance
A) extends
B) pane
C) event
D) inheritance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
A(n) ____ is a method of a class that is automatically executed when an object of the class is created.
A) inheritance
B) package
C) constructor
D) interface
A) inheritance
B) package
C) constructor
D) interface
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
Given the declaration, Integer x; After executing either of the following two statements, x points to an Integer object with value 8: x = 8;x = new Integer(8);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
Given the declaration, Integer num; The statement num = 8; is known as autoboxing of int type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
To compare the values of two Integer objects for equality, we can use the method equals of the class Integer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
The white areas in the figure above are used to do which of the following?
A) Show output
B) Get input
C) Get input and show results
D) Display a prompt to the user
A) Show output
B) Get input
C) Get input and show results
D) Display a prompt to the user
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which class is part of the package java.awt?
A) JFrame
B) JButton
C) JOptionPane
D) Container
A) JFrame
B) JButton
C) JOptionPane
D) Container
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) ____ and Rectangle is a(n) ____.Which word goes in the second blank of the sentence above?
A) subclass
B) superclass
C) method
D) package
A) subclass
B) superclass
C) method
D) package
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
Which of the following statements is NOT true about GUI programs?
A) Every GUI program requires a window.
B) Every window has a title, width, and height.
C) All components are added directly to the GUI window.
D) A layout must be created before components can be added to a content pane.
A) Every GUI program requires a window.
B) Every window has a title, width, and height.
C) All components are added directly to the GUI window.
D) A layout must be created before components can be added to a content pane.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
Which of the following is not a method of the class JTextField?
A) setText
B) setEditable
C) addActionListener
D) setVisible
A) setText
B) setEditable
C) addActionListener
D) setVisible
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
Write a program that takes as input the pay rate and hours worked of an employee and calculates the pay of the employee.Based on the problem statement above, which of the following would most likely be chosen as the class?
A) Pay_Rate
B) Hours_Worked
C) Employee
D) Pay
A) Pay_Rate
B) Hours_Worked
C) Employee
D) Pay
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
Which method is used to register a listener object to a button object?
A) addActionListener
B) registerButton
C) eventButton
D) buttonListener
A) addActionListener
B) registerButton
C) eventButton
D) buttonListener
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
Write a program to input the radius of the base and height of a cylinder, and calculate and print the surface area, volume, and area of the base of the cylinder.Which words from the problem statement above could we use to determine the operations for this program?
A) input, calculate, print
B) cylinder, program, volume
C) height, cylinder, radius
D) radius, cylinder, print
A) input, calculate, print
B) cylinder, program, volume
C) height, cylinder, radius
D) radius, cylinder, print
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
What is the name for Java classes that are provided so that values of primitive data types can be treated as objects?
A) interfaces
B) extensions
C) wrappers
D) event handlers
A) interfaces
B) extensions
C) wrappers
D) event handlers
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which modifier is used to build classes on top of classes that are interfaces?
A) private
B) public
C) new
D) implements
A) private
B) public
C) new
D) implements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
Which method contains the code that the program executes when a specific event is generated?
A) buttonListener
B) GUIListener
C) actionPerformed
D) windowListener
A) buttonListener
B) GUIListener
C) actionPerformed
D) windowListener
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
Write a program that takes as input the pay rate and hours worked of an employee and calculates the pay of the employee.Based on the problem statement above, which of the following would be a data member?
A) hoursWorked
B) employee
C) pay
D) job
A) hoursWorked
B) employee
C) pay
D) job
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
Which package will you most likely have to import in order to write a GUI program?
A) java.awt.*
B) java.io.*
C) java.text.*
D) java.net.*
A) java.awt.*
B) java.io.*
C) java.text.*
D) java.net.*
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
Write a program to input the radius of the base and height of a cylinder, and calculate and print the surface area, volume, and area of the base of the cylinder.According to the problem statement above, which of the following would be a data member?
A) Radius of the base
B) Surface area
C) Volume
D) Input
A) Radius of the base
B) Surface area
C) Volume
D) Input
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck