LIS4381 Exam 2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Code example: function get_product($product_id) {global $db;$query = "SELECT * FROM productsWHERE productID = '$product_id'";$product = $db->query($query);$product = $product->fetch();return $product;} Which of the following is a proper PHP statement for calling the function in this example and storing the returned result in a variable named $product. a. $product = get_product($product_id); b. $product = get_product(product_id); c. $product = $get_product($product_id); d. $product = $get_product(product_id);

a. $product = get_product($product_id);

Assume that the second radio button in the code below has been selected by the user. When you get the value of that radio button, what will the value be?<input type="radio" name="delivery" value="USPS" />USPS<input type="radio" name="delivery" value="FedEx" />Federal Express<input type="radio" name="delivery" value="UPS" />UPS a. FedEx b. Federal Express c. fedex d. federal express

a. FedEx

_________________ are variables associated with an object. a. Properties b. Components c. Elements d. Parameters

a. Properties

Oscar should use ____ to allow users to select the skateboard type(s). a. radio buttons b. check boxes c. command buttons d. group boxes

b. check boxes

Which term best describes a blueprint or a template for creating objects by defining its properties? a. app b. class c. control d. widget

b. class

Class variables are also known as _______________________________. a. class members b. data members c. classmates d. parameters

b. data members

To get the message that's related to an exception, you use the a. message property of the exception object b. getMessage method of the exception object c. message property of the exception class d. getMessage property of the exception class

b. getMessage method of the exception object

What is the method used to test a checked property on a radio button? a. getChecked() method ​ b. isChecked() method ​ c. checked() method ​ d. setChecked() method

b. isChecked() method

A function may require ____, which are values used by the function. a. terms b. parameters c. ids d. names

b. parameters

When you create a function definition (i.e., code a function) in PHP, you can list one or more ____________________ separated by commas (if more than one), and wrapped within parentheses. a. functions b. controls c. keywords d. parameters

d. parameters

Which method creates an intent to start another Activity? a. beginActivity method b. createActivity method c. prepareActivity method d. startActivity method

d. startActivity method

Code example: function get_product($product_id) {global $db;$query = "SELECT * FROM productsWHERE productID = '$product_id'";$product = $db->query($query);$product = $product->fetch();return $product;} What does this function return when it is called? a. an array of all the rows in the products table b. an array of all the rows with the specified category ID c. an array of the columns in the first row of the products table d. an array of the columns in the row with the specified product ID

d. an array of the columns in the row with the specified product ID

If you create a function with a variable number of parameters, you need to use a special PHP _____________________________ to get an array of the arguments that are passed to the function. a. data member b. class c. variable d. function

d. function

When you code a function in PHP, you start with the keyword __________________. a. function b. add c. get d. parameter

d. parameter

Why use Bootstrap? a. Saves time, responsiveness, customizable, easy layout design using grids, consistency, regular updates. b. Doesn't necessarily save time, but it does help with SEO, use of color, and marketing your site. c. It automatically includes ASP.NET and MS SQL Server that saves time, uses responsive design, and has regular updates. d. It automatically includes Java and MySQL that saves time, uses responsive design, and has regular updates.

a. Saves time, responsiveness, customizable, easy layout design using grids, consistency, regular updates.

In HTML, parameters are called a. attributes b. properties c. switches d. options

a. attributes

By using ____________________, you can put special characters into a string literal that would otherwise be interpreted incorrectly by PHP. a. escape sequences b. n2br function c. ASCII characters d. ANSI characters

a. escape sequences

What modifier can be added to the end of a regular expression in PHP to make it case insensitive? a. i b. g c. s d. a

a. i

The parameters within the parentheses of a function declaration are what kind of variables? a. local b. global c. unknown d. declared

a. local

For the color, Oscar should most likely use ___. a. radio buttons b. check boxes c. command buttons d. group boxes

a. radio buttons

What is a common mistake made when forming a conditional statement? a. using the assignment operator instead of the comparison operator b. using the compareTo method instead of the assignment operator c. using the greater than operator instead of the assignment operator d. using the less than operator instead of the comparison operator

a. using the assignment operator instead of the comparison operator

To add notes or comments, insert a comment tag using the syntax ______ a. <---comment> b. <!--comment--> c. </--comment> d. <!--comment!-->

b. <!--comment-->

How many radio buttons from the following code can be selected at any given time?<input type="radio" name="address" value="Home" />Home Address<input type="radio" name="delivery" value="FedEx" />Federal Express<input type="radio" name="delivery" value="UPS" />UPS a. 0 b. 1 c. 2 d. 3

c. 2

__________________________ the object means creating an object from a class. a. Editing b. Threading c. Instantiating d. Copying

c. Instantiating

In the catch block of a try/catch statement for handling PDO exceptions, you can get a message that describes the exception by using the getMessage method of the a. PDO object b. PDOStatement object c. PDOException object d. Result set array

c. PDOException object

ActiveX controls are identified using the ____ attribute. a. src b. classelem c. classid d. data

c. classid

By using the ____________________ function, you can send special characters to the browser in a way that they will be displayed correctly. a. xmlentities b. html5entities c. htmlentities d. xhtmlentities

c. htmlentities

When you using the address element, the address text is displayed in _____ by default. a. bold b. underline c. italics d. bold italics

c. italics

What is the entry point of an Activity? a. begin method b. onEntry method c. onCreate method d. prepare method

c. onCreate method

Using strnatcasecmp($str1, $str2) function for a "natural" comparison of two values a. is case-sensitive b. returns -1 if $str2 comes before $str1 c. would evaluate both "09" and "9" as being before "10" d. would evaluate "10" as being before both "09" and "9"

c. would evaluate both "09" and "9" as being before "10"


Set pelajaran terkait

Anatomy ii- Chapter 16 Lymphatic System

View Set

Chapter 4- Gravity and Orbits (COPY OF TEST)

View Set

Quiz 10: passive voice identify main subject and verb

View Set

Vocabulary Workshop Level E Unit 1 Answers

View Set

Cholera Case Study Questions and Answers

View Set

Using Fields, Forms and Macros in Word 365

View Set

Ohlone College ESL placement test sample

View Set

COMD 4450 Alternative/Integrative Assessment Lecture

View Set