wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Programming 3 Midterm exam

Total questions: 45

Worksheet time: 33mins

Name
Class
Date
1.

What does HTML stand for?

a)

Hyper Text Makeup Language

b)

Hyper Text Markup Language

c)

High Text Markup Language

d)

Hyperlinks Text Managing Language

2.

The <html> element is known as the:

a)

Title element

b)

Header element

c)

Root element

d)

Body element

3.

Which tag defines the document’s visible content?

a)

<head>

b)

<html>

c)

<body>

d)

<p>

4.

What tag defines a large heading in HTML?

a)

<heading>

b)

<h1>

c)

<h>

d)

<head>

5.

The <p>

tag in HTML defines:

a)

Paragraph

b)

Picture

c)

Page

d)

Print

6.

What does declare?<!DOCTYPE html>

a)

Document is HTML version 4

b)

Document is HTML5

c)

Document uses PHP

d)

Document is XML

7.

HTML elements are usually composed of:

a)

Content only

b)

Tags only

c)

Start tag, content, and end tag

d)

Attributes only

8.

A web browser does not display:

a)

HTML code

b)

Page content

c)

Images

d)

Headings

9.

The <title> element specifies:

a)

The main heading of the page

b)

The title shown in the browser tab

c)

The document’s body

d)

The page header

10.

Which of the following is the correct structure of an HTML document?

a)

b)

c)

d)

11.

The first version of HTML was invented in:

a)

1989

b)

1993

c)

1995

d)

2008

12.

The official organization that developed HTML 4.01 is:

a)

WHATWG

b)

W3C

c)

PHP Group

d)

Mozilla

13.

HTML 5 was officially recommended by W3C in what year?

a)

2010

b)

2014

c)

2016

d)

2017

14.

The <a> tag is used to:

a)

Insert images

b)

Create links

c)

Add alignment

d)

Mark a paragraph

15.

What attribute defines the destination of a hyperlink?

a)

src

b)

href

c)

link

d)

target

16.

The correct syntax of an HTML link is:

a)

<link href="url">text</link>

b)

<a src="url">text</a>

c)

<a href="url">text</a>

d)

<hyperlink>text</hyperlink>

17.

In HTML, images, hyperlinks, and text are all contained within the:

a)

<head>

b)

<body>

18.

What text editor is recommended for learning HTML on Windows?

a)

Word

b)

Notepad

c)

Dreamweaver

d)

Sublime

19.

HTML files are usually saved with which file extension?

a)

.txt

b)

.css

c)

.html

d)

.doc

20.

Which encoding is preferred when saving an HTML file?

a)

ASCII

b)

UTF-8

c)

ANSI

d)

Unicode-16

21.

What does PHP stand for?

a)

Personal Home Page

b)

Private Hosting Page

c)

PHP: Hypertext Preprocessor

d)

Programming Hypertext Page

22.

PHP is executed on the:

a)

Client

b)

Browser

c)

Server

d)

Operating system

23.

PHP files have what file extension?

a)

.ph

b)

.php

c)

.phtml

d)

.html

24.

PHP can generate:

a)

Static pages only

b)

Dynamic page content

c)

JavaScript files

d)

Only text output

25.

PHP can be used to:

a)

Send and receive cookies

b)

Design only CSS

c)

Replace HTML

d)

Build only offline applications

26.

Which of the following is not a use of PHP?

a)

Encrypt data

b)

Create, read, and write files

c)

Style web pages

d)

Control user access

27.

PHP is:

a)

Free and open-source

b)

Paid software

c)

Used only in Linux

d)

A desktop application

28.

The official website for PHP is:

a)

php.org

b)

www.php.net

c)

php.com

d)

php.edu

29.

PHP 7 introduced:

a)

Fewer operators

b)

Improved speed

c)

Deprecated bind_param

d)

Removal of MySQL

30.

PHP 7 supports which new operator?

a)

??

b)

<=>

c)

::

d)

->

31.

In PHP, $stmt refers to:

a)

Static memory

b)

Statement object

c)

String handler

d)

Stored table

32.

The purpose of placeholders ? in an SQL query is to:

a)

Comment code

b)

Represent variables safely

c)

End a query

d)

Define column names

33.

How many placeholders does this query have?

INSERT INTO items (name, description, price) VALUES (?, ?, ?)

a)

1

b)

2

c)

3

d)

4

34.

The method used to bind variables to placeholders is:

a)

$stmt->connect()

b)

$stmt->bind_param()

c)

$stmt->prepare()

d)

$stmt->run()

35.

In stmt>bindparam(stmt->bind_param( name, description,description, price);, what does “ssd” represent?

a)

String data types

b)

Variable names

c)

Data type order

d)

SQL fields

36.

In bind_param type string, the letter d stands for:

a)

Double

b)

Decimal

c)

Data

d)

Default

37.

The letter s in the bind_param type string represents:

a)

String

b)

Symbol

c)

SQL

d)

Static

38.

Which function actually sends and runs the SQL query?

a)

$stmt->execute()

b)

$stmt->run()

c)

$stmt->start()

d)

$stmt->perform()

39.

Which function frees memory and closes a prepared statement?

a)

$stmt->exit()

b)

$stmt->stop()

c)

$stmt->close()

d)

$stmt->end()

40.

Prepared statements help protect against:

a)

SQL injection

b)

CSS conflicts

c)

JavaScript errors

d)

PHP syntax errors

41.

What are the three main functions used in the prepared statement process?

a)

prepare(), bind_param(), execute()

b)

open(), close(), read()

c)

define(), connect(), commit()

d)

insert(), update(), delete()

42.

The “s” type in bind_param corresponds to what kind of data?

a)

Numeric

b)

Text

c)

Date

d)

Boolean

43.

Why use prepared statements?

a)

They make SQL code longer

b)

They reduce performance

c)

They improve security

d)

They skip variable binding

44.

What happens if you don’t use prepared statements?

a)

Code runs faster

b)

SQL injection becomes possible

c)

No effect on security

d)

PHP refuses to run

45.

mysqli->prepare() is used to:

a)

Bind variables

b)

Create a safe SQL statement

c)

Execute the query

d)

Encrypt user input