Chapter06
Chapter07
Chapter08
Chapter09
Chapter10
100

A web table contains multiple table rows with each row consisting of one or more table cells.

Answer

True

False


True

A web table is an HTML structure consisting of multiple table rows with each row containing one or more table cells.

100

The most common way of accepting user input is through a web form.

Answer

True

False


True

The most common way of accepting user input is through a web form, which allows users to enter data that can be saved and processed.

100

A challenge in delivering multimedia content is presenting it in a form that can be retrieved quickly and easily without loss of quality.

Answer

True

False


True

One of the biggest challenges in delivering multimedia content is putting that content in a form that can be retrieved quickly and easily without loss of quality.

100

JavaScript is a procedural language that needs a compiler to translate the code into machine language.

Answer

True

False


False

JavaScript is an interpreted language, meaning that the program code is executed directly without requiring an application known as a compiler to translate the code into machine language.

100

The appearance of a web table can be changed by modifying style sheets instead of the JavaScript code.

Answer

True

False


True

The calendar created in Tutorial 10 is constructed as a web table. Class names and IDs are assigned to the different parts of the table. These class and ID designations make it easier for page developers to assign different styles to the different parts of the calendar. If developers want to change the table's appearance, they will not have to edit the JavaScript code to do so; instead, they only will have to modify the style sheet.

200

For the widows property widows: value; the value is the minimum number of lines stranded before a column break.

Answer

True

False

False

To control the size of column widows (a line of text placed at the top of a column), use the following widows property: widows: value; where value is the minimum number of lines placed after the column break.

200

Client-side validation takes place within the user's browser.

Answer

True

False


True

The process of ensuring that the user has supplied valid data is called validation and can take place on the web server where it is known as server-side validation or within the user's own browser where it is referred to as client-side validation.

200

The task of controlling video playback requires an external JavaScript program as there are no CSS styles to control the video playback.

Answer

True

False

True

Because there are no CSS styles that control video playback, this task requires an external JavaScript program.

200

The isNaN(value) function returns a Boolean value of true if the value is not numeric.

Answer

True

False

True

The isNaN() function returns a Boolean value of true if the value is not numeric and false otherwise.

200

Statement labels are used to identify statements in JavaScript code so that the statements can be referenced elsewhere in a program.

Answer

True

False


True

Statement labels are used to identify statements in JavaScript code so that you can reference those lines elsewhere in a program.

300

The two types of table cells supported by web tables are _____.

Answer

row cells and column cells

header cells and data cells

border cells and caption cells

legend cells and web cells

header cells and data cells

Web tables support two types of table cells: header cells (marked using the th element) that contain content usually placed at the top of a column or the beginning of a row and data cells (marked with the td element) that contain content within those columns and rows.

300

Identify the significance of "text" in <form id="text">.

Answer

It identifies the form.

It is the content of the form.

It controls the form process.

It identifies the form attributes.

It identifies the form.

All web forms are marked using the following form element <form id="text" attributes> content </form> where the id attribute identifies the form (which is important when more than one form is being used on the web page), attributes specify how the form should be processed by the browser, and content is the form's content.

300

Data is compressed by removing redundant information using _____ compression.

Answer

lossless

lossy

irreversible

reversible

lossless

Using lossless compression, data is compressed by removing redundant information.

300

_____ programming distributes the load to prevent a server from getting overloaded with program-related requests.

Answer

Client-side

Server-side

Inductive

Semantic

Client-side

Client-side programming distributes the load so that one server is not overloaded with program-related requests; it tends to be more responsive because users do not have to wait for a response from a remote server.

300

Identify a method that is used to create a subarray.

Answer

concat()

slice()

assert()

sort()

slice()

In some scripts, you might want to extract a section of an array, known as a subarray. One way to create a subarray is with the following slice() method: array.slice(start, stop) where start is the index value of the array item at which the slicing starts and stop is the index value at which the slicing ends.

400

_________ are web page layouts in which content is displayed side-by-side in a page and differ from those layouts that use floating elements or flexboxes.

Column layouts

400

_________ refers to the state in which an element has been clicked by the user, making it the active control on the form.

Focus

400

To define a sequence of key frames in CSS, the _________ rule is applied.

@keyframes

400

Because JavaScript includes _________ in its time calculations, the seconds value in a countdown clock may sometimes appear off by a second.

leap seconds

400

The _________ returns the integer remainder after dividing one integer by another.

modulus operator% operator

500

What are the CSS properties that are used to manage column breaks?

The placement of column breaks can be controlled through several CSS properties.

 

The size of column orphans (a line of text stranded at the bottom of a column) can be controlled using the following orphansproperty:
                                      orphans: value;
where value is the minimum number of lines stranded before a column break. Similarly, to control the size of column widows (a line of text placed at the top of a column), the following widows property is used:
                widows: value;
where value is the minimum number of lines placed after the column break.

 

Another way to define a column break is to use the properties

break-before: type;
break-after: type;

where type can be either auto (to allow the browser to automatically set the column break), always (to always place a break), or avoid (to avoid placing a column break).

500

Describe the types of layouts that are used to design a form.

To be effective, the layout of the form should aid the user in interpreting the form and navigating easily from one input control to the next. There are two general layouts, one in which the labels are placed directly above the input controls in a single column and the other in which the labels and controls are placed side by side in two columns.

 

Usability studies have shown that a single column layout is more accessible because the labels are placed more closely to their input controls. However, for long forms involving many fields, a single column layout can be difficult to work with due to the extensive vertical space required.

 

The width of an input box is set by adding the following size attribute to the input element in the HTML file:

size="chars"

Here, chars is the width of the input box in characters. For example, the following input element sets the width of the input box for a field to two characters:

<input id="state" size="2" type="text" /> 

500

Briefly explain how to control an animation.

In many applications, a user may not want an animation to start automatically when the page loads but rather in response to the user clicking a form button. The user can control an animation using JavaScript or a CSS solution.


Because an animation can have two states of operation—play or pause—a user can utilize a check box to control the animation. If the check box is selected, the animation will play; if the check box is not selected, the animation will be paused.

500

Explain the syntax to reference objects in JavaScript.


Each object within a hierarchy is referenced by its object name such as window, document, or navigator. Because every object aside from the window object is nested within other objects, they can be referenced using the notation

 

object1.object2.object3...


where object1 is at the top of the hierarchy, object2 is a child of object1, and so on. Thus, to reference the images object nested within the window and document object, one would use the JavaScript expression:

 

window.document.images

 

To reference a specific member of an object collection, we can use either

 

collection[idref]

 

or

 

collection.idref

 

where collection is a reference to the object collection, and idref is either an index number representing the position of the object in the collection or the value of the id attribute assigned to the element. The first object in the collection has an index number of 0 with subsequent objects given index numbers of 1, 2, 3, and so on.

 

Object collections can also be based on tag names using the expression

 

document.getElementsByTagName(tag)

 

where tag is the name of an HTML element. 

 

Object collections can also be formed from HTML elements belonging to the same class by using the expression

 

document.getElementsByClassName(class)

 

where class is the value of the class attribute from the HTML document.

 

Another, more efficient approach, is to reference an element by its name or id attribute, using the expressions:

document.getElementsByName(name)
document.getElementById(id)

 

Only one object is returned, not a collection, because each id value is unique within an HTML document.

500

Briefly explain the process of using arrays as data stacks.

Arrays can be used to store information in a data structure known as a stack in which new items are added to the top of the stack—or to the end of the array—much like a person clearing a dinner table adds dishes to the top of a stack of dirty plates. A stack data structure employs the last-in first-out (LIFO) principle in which the last items added to the stack are the first ones removed. Stack data structures are encountered when using the Undo feature of some software applications, in which the last command a user performed is the first command that is undone.


JavaScript supports several methods to allow a user to work with a stack of array items. For example, the push() method appends new items to the end of an array. It has the syntax


array.push(values)


where values is a comma-separated list of values to be appended to the end of the array. To remove—or unstack—the last item, the pop() method is used, as follows:


array.pop()


The following set of commands demonstrates how to use the push() and pop() methods to employ the LIFO principle by adding and then removing items from a data stack:


var x = ["a", "b", "c"];

x.push("d", "e"); // x = ["a", "b", "c", "d", "e"]

x.pop(); // x = ["a", "b", "c", "d"]

x.pop(); // x = ["a", "b", "c"]


In this code, the push() method adds two items to the end of the array, and then the pop() method removes those last items one at a time.


A queue, which employs the first-in-first-out (FIFO) principle in which the first item added to the data list is the first removed, is similar to a stack. An example of the FIFO principle in action is a line of people waiting to be served. For array data that should be treated as a queue, the shift() method is used, which is similar to the pop()method except that it removes the first array item, not the last item. JavaScript also supports the unshift() method, which inserts new items at the front of the array.