wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

2nd Summative Test in Computer Programming 3

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

What does AWT stand for in Java?

a)

Advanced Window Tools

b)

Abstract Window Toolkit

c)

Automated Window Technology

d)

Application Window Terminal

2.

How do you create relationships between tables?

a)

Database Tools → Relationships

b)

Table → Add Relationship

c)

Tools → Define Relations

d)

File → New Relationship

3.

What class provides graphics capabilities in Applets?

a)

GraphicsContext

b)

Graphics

c)

DrawingTools

d)

GraphicsKit

4.

Which view shows the table structure in MS Access?

a)

Form View

b)

Design View

c)

Datasheet View

d)

SQL View

5.

What is the base class for all AWT components?

a)

Window

b)

Frame

c)

Component

d)

Container

6.

Which command creates a new database in MySQL?

a)

CREATE DATABASE database_name;

b)

MAKE DATABASE database_name;

c)

NEW DATABASE database_name;

d)

GENERATE DATABASE database_name;

7.

What class is used to create dialog boxes?

a)

JMessageBox

b)

JDialog

c)

DialogBox

d)

SwingDialog

8.

Which class serves as the top-level container in Swing applications?

a)

JComponent

b)

JFrame

c)

JPanel

d)

Container

9.

Which method sets the background color of an Applet?

a)

background()

b)

setColor()

c)

setBackground()

d)

setBgColor()

10.

Which component creates a clickable button?

a)

PushButton

b)

Button

c)

ClickButton

d)

ActionButton

11.

What method fills a rectangle with color?

a)

drawRect()

b)

rectangle()

c)

fillRect()

d)

colorRect()

12.

Which data type is used for currency in MS Access?

a)

Money

b)

Currency

c)

Decimal

d)

Number

13.

Which method sets the size of an AWT window?

a)

setSize()

b)

resize()

c)

setDimensions()

d)

setWindowSize()

14.

Which SQL constraint ensures a column cannot have NULL value?

a)

NOT EMPTY

b)

NOT NULL

c)

NO NULLS

d)

REQUIRED

15.

What listener interface is used for button click events?

a)

MouseListener

b)

KeyListener

c)

ActionListener

d)

WindowListener

16.

How do you set the current drawing color?

a)

drawColor()

b)

setColor()

c)

useColor()

d)

changeColor()

17.

What method is called first in an Applet's lifecycle?

a)

start()

b)

paint()

c)

init()

d)

run()

18.

Which package contains AWT classes?

a)

java.awt

b)

javax.awt

c)

java.window

d)

java.gui

19.

How do you delete specific records?

a)

DELETE FROM table WHERE condition;

b)

REMOVE FROM table WHERE condition;

c)

DELETE records FROM table;

d)

ELIMINATE FROM table WHERE condition;

20.

What interface handles mouse events in AWT?

a)

MouseHandler

b)

MouseAdapter

c)

MouseListener

d)

MouseEvents

21.

How do you draw text in an Applet?

a)

writeText()

b)

drawText()

c)

drawString()

d)

setText()

22.

What is the main purpose of a Java Applet?

a)

To create standalone applications

b)

To create web-embedded programs

c)

To manage databases

d)

To handle server operations

23.

What package contains most Swing components?

a)

java.awt

b)

javax.swing

c)

java.ui

d)

java.graphics

24.

How do you create a new form?

a)

Create → Form

b)

Insert → New Form

c)

File → Add Form

d)

Tools → Form Design

25.

Which method fills an oval shape?

a)

fillOval()

b)

colorOval()

c)

paintOval()

d)

fillCircle()

26.

What component displays a single line of text?

a)

TextArea

b)

TextField

c)

Label

d)

Text

27.

Which command shows the structure of a table?

a)

SHOW STRUCTURE table_name;

b)

DESCRIBE table_name;

c)

DISPLAY table_name;

d)

VIEW table_name;

28.

Which component displays a single line of text?

a)

JTextArea

b)

JTextPane

c)

JTextField

d)

JText

29.

What is the maximum size of a Text field in MS Access?

a)

255 characters

b)

500 characters

c)

1000 characters

d)

Unlimited

30.

Which method draws a straight line?

a)

drawLine()

b)

line()

c)

createLine()

d)

makeLine()

31.

How do you create a new table in MySQL?

a)

CREATE TABLE table_name;

b)

MAKE TABLE table_name;

c)

CREATE TABLE table_name (column definitions);

d)

NEW TABLE table_name;

32.

Which class represents a pop-up dialog box?

a)

PopupWindow

b)

MessageBox

c)

Dialog

d)

AlertBox

33.

Which method is used to make a Swing window visible?

a)

show()

b)

display()

c)

open()

d)

setVisible()

34.

Which view allows SQL query editing?

a)

Design View

b)

SQL View

c)

Query View

d)

Code View

35.

What is the correct syntax to use a specific database?

a)

ENTER database_name;

b)

USE database_name;

c)

SELECT database_name;

d)

OPEN database_name;

36.

What method sets the size of a Swing window?

a)

setSize()

b)

resize()

c)

setDimension()

d)

setWindowSize()

37.

What parameter specifies Applet width in HTML?

a)

size

b)

length

c)

dimension

d)

width

38.

Which component creates a checkbox?

a)

Check

b)

Box

c)

Checkbox

d)

ToggleBox

39.

Which command shows all databases?

a)

SHOW DATABASES;

b)

LIST DATABASES;

c)

DISPLAY DATABASES;

d)

SELECT DATABASES;

40.

How do you create a menu bar in Swing?

a)

MenuBar()

b)

createMenuBar()

c)

JMenuBar()

d)

SwingMenuBar()

41.

What component allows multiple line text input?

a)

TextArea

b)

TextField

c)

TextBox

d)

TextInput

42.

What context is needed to run an Applet?

a)

Web browser

b)

Command prompt

c)

IDE

d)

Operating system

43.

How do you draw an arc?

a)

makeArc()

b)

createArc()

c)

drawArc()

d)

arc()

44.

How do you create a primary key in MS Access table design?

a)

Right-click and select Primary Key

b)

File → Set Primary Key

c)

Tools → Primary Key

d)

Database → Add Key

45.

What is the correct way to order results in descending order?

a)

SORT DESC

b)

ORDER BY DESC

c)

DESCENDING ORDER

d)

ORDER DESCENDING

46.

Which component allows users to select multiple options?

a)

JRadioButton

b)

JToggleButton

c)

JButton

d)

JCheckBox

47.

What package contains the Applet class?

a)

java.awt

b)

java.applet

c)

javax.swing

d)

java.lang

48.

Which method shows an AWT window?

a)

show()

b)

display()

c)

setVisible()

d)

open()

49.

What is the correct syntax for an AUTO_INCREMENT primary key?

a)

id INT PRIMARY KEY AUTO_INCREMENT

b)

id INT AUTOINCREMENT PRIMARY

c)

id INT INCREMENT KEY

d)

id INT PRIMARY AUTONUM

50.

Which component is used to display multiple lines of text?

a)

JLabel

b)

JTextArea

c)

JTextField

d)

JButton