CS 2830 Final Exam

Ace your homework & exams now with Quizwiz!

What is the correct jQuery code to set the background color of all h1 elements to green?

$("h1").css("background-color", "green");

$get(responder.php, [choice=1], function(data){ $(#contentBox).innerHTML(data); }); Which rewrite of the line will correct the error or errors?

$.get("responder.php", { "choice": 1 }, function(data){ $("#contentBox").html(data); });

Which of the following arrays holds information about images that were uploaded using a form?

$_FILES

HTML:

- HTML stands for Hyper Text Markup Language - HTML is the standard markup language for creating Web pages - HTML describes the structure of a Web page - HTML consists of a series of elements - HTML elements tell the browser how to display the content

What are true about POST requests?

- POST requests are used for sensitive information - POST requests are never cached - POST requests do not remain in the browser history - POST do not have restrictions on data length

What is JSON?

- a syntax for storing and exchanging data. - text, written with JavaScript object notation.

What is the technique shown in class to upload multiple files in a form element?

<input type="file" name="files[]" multiple>

What does the following CSS selector reference? p, span { ... }

All 'p' elements and all 'span' elements

Every ______ object has a prototype.

JavaScript

What does JSON stand for?

JavaScript Object Notation

All ___________ inherit their properties and methods from their prototype.

JavaScript objects

What happens if two declarations have the same level of specificity?

Last one declared will be applied

What does SQL stand for?

Structured Query Language

If a cookie is set using PHP's setcookie() function without an expiration date, which of the following is true?

The cookie expires after the browser is closed

By default is a span an inline or block element?

inline

Assume you have an existing associative array, $people, that already contains username and email values. What is the PHP statement to add a 'position' element to the array that has a value of 'student' while keeping the username and email elements unchanged?

$people['position'] = 'student';

The following code generates a syntax error or errors. The purpose of the line of code below is to create an associative array and store it in the $resultPet variable. Which rewrite of the line below will correct the error or errors? $result Pet = ('name' = 'scratchy', 'type' = 'cat', 'age' = 3);

$resultPet = array('name' => 'scratchy', 'type' => 'cat', 'age' => 3);

A version control system allows programmers to:

- Can determine how much work each team member has done - Revert the entire project back to a previous state - Allows multiple programmers to work on the same project at the same time while keeping track of everyone's changes - See who introduced an issue and when - Compare changes over time - Revert files back to a previous state

What is the differences between a PHP echo and a PHP print statement?

- Echo has no return value while print statement does - Echo is marginally faster than print - Echo can take multiple parameters while print can only take one

What are true about GET requests?

- GET requests remain in the browser history - GET requests have length restrictions - GET requests can be bookmarked - GET requests can be cached

Git

- Git is a type of version control system (VCS) that makes it easier to track changes to files. - You can periodically update and keep a backup of your projects after updating or release new builds for your project.

What is the main idea behind a MVC architectural pattern?

- MVC helps the code to be more readable, easier to maintain, more secure, easier to reuse code and allows simultaneous work between developers who are responsible for different MVC components - We must have the following responsibilities of the M, V, and C clearly separated in our application - The C communicates with the M, the C communicates with the V, but the V and the M never communicate with each other directly

What does SQL do?

- SQL lets you access and manipulate databases - SQL can execute queries against a database - SQL can retrieve data from a database - SQL can insert, update, and delete records in a database - SQL can create new databases and new tables in a database

FROM

- The FROM command is used to specify which table to select or delete data from. - The following SQL statement selects the "CustomerName" and "City" columns from the "Customers" table: SELECT CustomerName, City FROM Customers;

SELECT

- The SELECT statement is used to select data from a database. - The data returned is stored in a result table, called the result-set.

WHERE

- The WHERE clause is used to filter records. - The WHERE clause is used to extract only those records that fulfill a specified condition.

What does AJAX do?

- Update a web page without reloading the page - Request data from a server - after the page has loaded - Receive data from a server - after the page has loaded - Send data to a server - in the background

How do you write comments in PHP?

// this is a comment /* this is a comment */ # this is a comment

Know the proper ordering of SQL statements

1. FROM and JOIN 2. WHERE 3. GROUP BY 4. HAVING 5. SELECT 6. DISTINCT 7. ORDER BY 8. LIMIT / OFFSET

Specificity of CSS

1. Inline styles 2. IDs 3. Classes, attributes and pseudo-classes 4. Elements and pseudo-elements

Which of the following tags is correctly formatted for a form that supports file uploads?

<form name="form1" id="form1" method="POST" action="proc.php" enctype="multipart/form-data"></form>

Which of the following is not valid HTML?

<img href='myImage.png' alt='image1' /> (should be src instead)

var xmlHttp = new XMLHttpRequest(); xmlHttp.onload = function() {if (xmlHttp.status == 200) {var xmlDoc = xmlHttp.responseText; } } Now after the execution of the above code, xmlDoc will contain what type of variable?

A string

What does AJAX stand for?

Asynchronous JavaScript And XML

There is no function in PHP that will randomize the order of items in an array. To randomize the order of items in an array, you must write your own function to do it.

False The function is called shuffle()

Cookies are passed between client and server using _______.

HTTP Headers

Which selector has the highest specificity?

Inline

What does the CSS float property do?

It aligns an HTML element to the right or left while allowing content to flow around it

What are the two commonly used methods for a request-response between a client and server?

POST, GET

AJAX requests and responses can contain cookies.

True

class myClass { public function get_v3() { return $this->v3; } } Can the get_v3 method be called on an instance of a myClass object?

True

Are SQL keywords case sensitive?

Yes

How do you display hyperlinks without an underline?

a {text-decoration: none;}

Which CSS statement causes the table borders to collapse into a single border?

border-collapse: collapse;

Which of the following CSS will display text colored blue?

color: #0000ff;

What CSS property is used to changed an inline element into a block element?

display: block;

Which CSS selector will reference both div elements in the HTML provided below? <div id="note"> <div class="concentrate"><p>This is a <span class="highlight">awesome</span> message.</p></div> </div>

div

Which of the following CSS selector will match only div elements that have a class of 'advanced'?

div.advanced

The JavaScript prototype is also an _________.

object

Which of the following CSS selectors will match any <a> element inside of any <p> element?

p a

Which of the following indicates 13px padding left, 12px padding top, 44px padding bottom, and 24px padding right?

padding: 12px 24px 44px 13px;

If you want to load an external PHP file into a PHP script and want a fatal error to be generated if the external PHP file could not be found, which of the following PHP statements would you use?

require

Which is a basic encryption method, shown in class, that calculates the hash of a string using a US Secure Hash Algorithm?

sha1($userInput)

RDBMS store data and that data is stored in __________ which are also known as database objects and is essentially a collection of data that is related and consists of columns and rows.

tables

Which of the following JavaScript statements will locate an object on a webpage with an id of 'cs2830'?

var myVar = document.getElementById('cs2830');

$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5); echo json_encode($arr); What will be printed by the echo after the above code is executed ?

{ "a":1, "b":2, "c":3, "d":4, "e":5}


Related study sets

Chapter 38: Family-Centered Care of the Child During Illness and Hospitalization Flash Cards

View Set

OB Practice: Nursing Care of the Newborn with Special Needs

View Set

Chapter 4 Estates an interest in real property Principles and practices of New Jersey real estate by Frank W Kovats

View Set

BUSI301: Business Law (B07) Chapter 24

View Set

Gynaecology - Anatomy of the female genital organs

View Set

chapter 9: employment and unemployment

View Set