NEW
Font size
Worksheets2nd Summative Test in Computer Programming 3
Total questions: 50
Worksheet time: 25mins
What does AWT stand for in Java?
Advanced Window Tools
Abstract Window Toolkit
Automated Window Technology
Application Window Terminal
How do you create relationships between tables?
Database Tools → Relationships
Table → Add Relationship
Tools → Define Relations
File → New Relationship
What class provides graphics capabilities in Applets?
GraphicsContext
Graphics
DrawingTools
GraphicsKit
Which view shows the table structure in MS Access?
Form View
Design View
Datasheet View
SQL View
What is the base class for all AWT components?
Window
Frame
Component
Container
Which command creates a new database in MySQL?
CREATE DATABASE database_name;
MAKE DATABASE database_name;
NEW DATABASE database_name;
GENERATE DATABASE database_name;
What class is used to create dialog boxes?
JMessageBox
JDialog
DialogBox
SwingDialog
Which class serves as the top-level container in Swing applications?
JComponent
JFrame
JPanel
Container
Which method sets the background color of an Applet?
background()
setColor()
setBackground()
setBgColor()
Which component creates a clickable button?
PushButton
Button
ClickButton
ActionButton
What method fills a rectangle with color?
drawRect()
rectangle()
fillRect()
colorRect()
Which data type is used for currency in MS Access?
Money
Currency
Decimal
Number
Which method sets the size of an AWT window?
setSize()
resize()
setDimensions()
setWindowSize()
Which SQL constraint ensures a column cannot have NULL value?
NOT EMPTY
NOT NULL
NO NULLS
REQUIRED
What listener interface is used for button click events?
MouseListener
KeyListener
ActionListener
WindowListener
How do you set the current drawing color?
drawColor()
setColor()
useColor()
changeColor()
What method is called first in an Applet's lifecycle?
start()
paint()
init()
run()
Which package contains AWT classes?
java.awt
javax.awt
java.window
java.gui
How do you delete specific records?
DELETE FROM table WHERE condition;
REMOVE FROM table WHERE condition;
DELETE records FROM table;
ELIMINATE FROM table WHERE condition;
What interface handles mouse events in AWT?
MouseHandler
MouseAdapter
MouseListener
MouseEvents
How do you draw text in an Applet?
writeText()
drawText()
drawString()
setText()
What is the main purpose of a Java Applet?
To create standalone applications
To create web-embedded programs
To manage databases
To handle server operations
What package contains most Swing components?
java.awt
javax.swing
java.ui
java.graphics
How do you create a new form?
Create → Form
Insert → New Form
File → Add Form
Tools → Form Design
Which method fills an oval shape?
fillOval()
colorOval()
paintOval()
fillCircle()
What component displays a single line of text?
TextArea
TextField
Label
Text
Which command shows the structure of a table?
SHOW STRUCTURE table_name;
DESCRIBE table_name;
DISPLAY table_name;
VIEW table_name;
Which component displays a single line of text?
JTextArea
JTextPane
JTextField
JText
What is the maximum size of a Text field in MS Access?
255 characters
500 characters
1000 characters
Unlimited
Which method draws a straight line?
drawLine()
line()
createLine()
makeLine()
How do you create a new table in MySQL?
CREATE TABLE table_name;
MAKE TABLE table_name;
CREATE TABLE table_name (column definitions);
NEW TABLE table_name;
Which class represents a pop-up dialog box?
PopupWindow
MessageBox
Dialog
AlertBox
Which method is used to make a Swing window visible?
show()
display()
open()
setVisible()
Which view allows SQL query editing?
Design View
SQL View
Query View
Code View
What is the correct syntax to use a specific database?
ENTER database_name;
USE database_name;
SELECT database_name;
OPEN database_name;
What method sets the size of a Swing window?
setSize()
resize()
setDimension()
setWindowSize()
What parameter specifies Applet width in HTML?
size
length
dimension
width
Which component creates a checkbox?
Check
Box
Checkbox
ToggleBox
Which command shows all databases?
SHOW DATABASES;
LIST DATABASES;
DISPLAY DATABASES;
SELECT DATABASES;
How do you create a menu bar in Swing?
MenuBar()
createMenuBar()
JMenuBar()
SwingMenuBar()
What component allows multiple line text input?
TextArea
TextField
TextBox
TextInput
What context is needed to run an Applet?
Web browser
Command prompt
IDE
Operating system
How do you draw an arc?
makeArc()
createArc()
drawArc()
arc()
How do you create a primary key in MS Access table design?
Right-click and select Primary Key
File → Set Primary Key
Tools → Primary Key
Database → Add Key
What is the correct way to order results in descending order?
SORT DESC
ORDER BY DESC
DESCENDING ORDER
ORDER DESCENDING
Which component allows users to select multiple options?
JRadioButton
JToggleButton
JButton
JCheckBox
What package contains the Applet class?
java.awt
java.applet
javax.swing
java.lang
Which method shows an AWT window?
show()
display()
setVisible()
open()
What is the correct syntax for an AUTO_INCREMENT primary key?
id INT PRIMARY KEY AUTO_INCREMENT
id INT AUTOINCREMENT PRIMARY
id INT INCREMENT KEY
id INT PRIMARY AUTONUM
Which component is used to display multiple lines of text?
JLabel
JTextArea
JTextField
JButton
