CIS 110 Final Questions – Flashcards
Unlock all answers in this set
Unlock answersquestion
what is the best reason to include height and width attributes on an tag.
answer
to help the browser render the page faster because it reserves the appropriate space for the image
question
What is the browser's action when you configure BOTH a background color and background image for the body selector?
answer
display the background color while the background image loads and before the background image is displayed
question
When a web page uses graphics for the main navigation links, provide accessibility by:
answer
providing text links on the bottom of the page
question
A(n) ________ is an image that is configured so that parts of the image can be used as one or more hyperlinks.
answer
image map
question
What is the code below that will configure a background image called parchment.gif for a web page using CSS?
answer
body {background-image:url(parchment.gif); }
question
what is the code below that uses CSS to eliminate the default border on an image configured as an image?
answer
img {border: 0; }
question
The theorem that states that any program logic can be written using only three constructs is called the ________________theorem
answer
Structure
question
Counted repetition refers to the idea that an index is _________ and then tested each time the loop iterates.
answer
incremented
question
What controls a for loop?
answer
iteration variable
question
How many iterations will occur in this loop? for (again = 1; again ;=5; again = again + 1) {...}
answer
5
question
what code iterates 10 times?
answer
) for (i = 1; i ;=10; i = i + 1)
question
What is an example of an infinite loop?
answer
for (i = 1; i ;= 4; i = i - 1)
question
What does + mean in javascript?
answer
addition or concentration
question
in the line: var rows = new Array(5); what will result?
answer
the first item in the array will be rows[0]
question
what is clearTimeout used for?
answer
Cancelling a timer
question
For the elements of the array to store an image, they must be initialized to a(n):
answer
image object
question
In a for loop, the operation that sets the variable's value for the first iteration of the loop is the:
answer
initialization
question
What is an indexed base name?
answer
array
question
What is the standard form of the World-Famous Iteration? (WFI)
answer
) for ( j=0; j<n; j++) { . . . }
question
Which is the first step in the program development cycle?
answer
Analyze the problem
question
What is not a control structure?
answer
syntax
question
What is not one of the primary Javascript data types?
answer
float
question
What data type can only have one of two possible values?
answer
Boolean
question
What is not an acceptable variable name?
answer
1_Name
question
What is not an acceptable variable name for a friend?
answer
my friend
question
If the variable hours = 10, what is the value of the variable salary after the following instruction has been executed: salary = hours * 8
answer
80
question
which method allows you to display text on an html page?
answer
write()
question
Which method will retrieve the contents of an html element?
answer
getElementByld()
question
Evaluate 8 % 7
answer
1
question
Given: a = 4 and b = 3, evaluate: (14 % a ) * a * b / 6 + (b * b)
answer
13
question
If car = "Honda", how does the following expression evaluate: (car < "Toyota");
answer
true value
question
If beverage = "tea", which of the following is true?
answer
!(beverage != "tea");
question
Which is equivalent to (X > 5) given that X is a numeric variable.
answer
!(X <= 5)
question
Which of the following will assign the variable named timCall to the sentence: Tim called, "Lassie, come home!"
answer
var timCall = 'Tim called, "Lassie, come home!"';
question
Which of the following is NOT a valid variable name for a dog?
answer
dogs-rule
question
Given the following code snippet, what will be displayed on the web page if the user enters 4 at the prompt? var myNum = prompt("Enter a number:"); var result = myNum + myNum; document.write(result);
answer
44
question
Given the following code snippet, what will be displayed on the web page if the user enters 4 at the prompt? var myNum = prompt("Enter a number:"); var result = myNum * myNum; document.write(result);
answer
16
question
Given the following code snippet, what will be displayed on the web page? var X = 23; var Y = 3; var Z = X + Y; document.write(Z);
answer
26
question
Given the following code snippet, what will be displayed on the web page if the user enters 6.35 at the prompt? var A = prompt("Enter a number:"); document.write(parseFloat(A) + ", "); document.write(parseInt(A)); a. 6.35NaN b. 6.35 c. 6.35, 6 d. 6.35, 6.35
answer
6.35, 6
question
Given the following code snippet, what will be displayed on the web page if the user enters 55 at the prompt? var result = "Yes!"; var multiply = prompt("What is 5 * 11?"); result = (parseInt(multiply) == 55)?"Correct":"Incorrect"; document.write(result);
answer
correct
question
What type of loop executes at least once?
answer
post-test
question
what is the value of x after the following statement executes, given that initially x = 8: x*=3;
answer
24
question
How many times will "bye bye" display after the following code is executed? var b = 3; var g = 1; do { document.write("bye bye"); g++; } while (g > b)
answer
1
question
What is the result of the following code snippet? var car = 4; var result = isNaN(car); document.write(result);
answer
True
question
What is the value of the variable myLetter after the following statements are executed? var name = "Santa Claus"; var myLetter = name.charAt(3);
answer
"t"
question
What function will generate a random number between 1 and 100, inclusive
answer
. num = (Math.floor(Math.random() * 100) + 1;
question
Which of the following will display "cost is $23.95", assuming cost = 23.9487 ?
answer
document.write("cost is " + cost.toFixed(2);
question
In the following statement, what is the initial condition, given that y = 600? for(x = 500; x > y; x++)
answer
x = 500
question
What is the value of count when the following loop is exited? var count = 20; while( count < 200) count*=3;
answer
540
question
What will be displayed after the following loop is exited? var name = "Liam"; for(var x = 3; x < 0; x--) document.write(name.charAt(x) + ", ");
answer
m a I L
question
What is the value of address, given: myAddress = "123 Duck Street, NW"; address = myAddress.length;
answer
19
question
What is the value of street given: var street = " "; myAddress = "123 Duck Street, NW"; for( var x = 4; x <= 7; x++) street = street + myAddress.charAt(x);
answer
Duck
question
From language to language, generally an identifier:
answer
starts with a letter and is followed by letters, numerals, or the underscore
question
Which of the following is a valid JavaScript variable name?
answer
BR549
question
In JavaScript, the escape symbol is the:
answer
backslash ()
question
Which of the following is not a suitable assignment statement?
answer
length * width = area
question
The value used for a variable on the right side of an assignment statement is:
answer
the value before the statement is executed
question
The first step in solving a programming expression is to process:
answer
the part of the expression inside the parentheses
question
In JavaScript, 17%5 is:
answer
2
question
An if statement must have:
answer
a semicolon at the end of it
question
How is an empty string written?
answer
""
question
string constants/literals are:
answer
surrounded by quotes in Javascript code
question
Javascript is:
answer
an interpreted language, meaning that the program code is executed directly without compiling
question
what side programs do not require users to wait for data to be sent over the Internet to a Web server?
answer
client
question
What code can be inserted directly into an HTML file or placed in a separate text file that is linked to a Web page?
answer
Javascript
question
Placing JavaScript code in a Web page file means that users need to retrieve only ____ file from the server.
answer
1
question
What is the type of attribute value for Javascript?
answer
text/javascript
question
there is no limit to the number what elements used within a web page?
answer
script
question
what section of a web page can scripts be placed?
answer
head and body
question
JavaScript supports comment tags, using a set of double ____ at the beginning of a line that instructs the browser to ignore the line and not interpret it as a JavaScript command.
answer
slashes
question
One way to handle the way that XML parsers treat the content of a JavaScript program is to place the JavaScript code within a(n) ____ section.
answer
CDATA
question
The text string specified by the document.write() method can be enclosed within what?
answer
double quotation marks or single quotation marks
question
Each JavaScript command line ends with a(n) ____ to separate it from the next command line in the program.
answer
semicolon
question
An action for the browser to take in a script is called what?
answer
a command and a statement
question
You can display single quotation marks with the document.write() method by enclosing your text string within what?
answer
double quotation marks
question
Another method to write text to the Web page is the what method?
answer
document.writeIn()
question
Why must you pay attention to whether or not letters are capitalized in javascript?
answer
javascript is case sensitive
question
what does javascript do with most occurrences of white space?
answer
ignores it
question
you can indicate that a statement continues on the next line using what?
answer
backslash
question
what are useful because they can store information created in one part of your program and use that information in another?
answer
variables
question
naming a variable, the first character must be either a letter or what?
answer
underscore
question
variable names cannot contain what?
answer
spaces
question
variable declarations should be placed at what part of a program to make interpretation easier?
answer
beginning
question
what is any group of characters such as "hello" or "happy holidays!"?
answer
text string
question
Variable names declared in a function can be used when? 19
answer
only inside that function
question
what is not a part of a function?
answer
global variables
question
output directly onto a web page from javascript is done using what?
answer
document.write()
question
a variable declared in a function is what?
answer
local variable
question
in javascript the result of a function call can be printed on the monitor how?
answer
with the alert( ) call interactively after the page is displayed while building the page on the fly
question
a function that cannot be reused:
answer
cannot be used as a building block
question
javascript function that retrieves the current date and time in numeric form is what?
answer
date()
question
the function toString():
answer
converts a numeric form to a printable form
question
what is another word for function?
answer
procedure, subroutine, method
question
how would you find the time between two dates?
answer
divide the difference by 1000 to find the seconds
question
which function loads the page that is specified as its first arguement?
answer
window.open()
question
what are inputs also called?
answer
parameters
question
the random numbers generated by math.random():
answer
are really pseudo-random
question
the values returned by the Math.random() function are between
answer
0 (inclusive) and 1 (exclusive)
question
before you use a variable in javascript you should what?
answer
declare it
question
what is an exemple of a non numeric value data type?
answer
"12"
question
how many data types does javascript support?
answer
4
question
you can cause a variable to have no value by assigning it what value?
answer
Null
question
what symbol can be used to combine text strings?
answer
+
question
what language forces programming to explicitly identify a variable's data type?
answer
strongly typed
question
when used with both numbers and text, what symbol treats the numbers as text?
answer
c. +
question
when variables are not strictly tied to specific data types, programmers refer to the language as_____ typed language
answer
loosely
question
if you follow z+1 with the statement z="3", then z has what data type?
answer
text string
question
If x has the value 5 and the variable y has the value "combo", then y + " no " + x results in what value?
answer
combo no 5
question
a function includes what function which identifies it?
answer
name
question
a function may require what values used by the function?
answer
parameters
question
what commands can be used in a function?
answer
return 3; z=1+2; document.write("Hello World");
question
What does the JavaScript command document.println("Hello" + "World"); print? 19
answer
HelloWorld
question
what is X in xml?
answer
extensible
question
what are the similarities between xml and html
answer
are markup languages derive from sgml use tags
question
what is mandatory in xml?
answer
document root element
question
where is other optional info placed?
answer
in the prolog
question
if you use and xml declaration at the top of an xml doc then
answer
it must be the 1st thing
question
the doc type definition is a statement of what?
answer
the permitted structure of the xml
question
what can you do if you know the structure and properties of data?
answer
retrieve it organize it manage it
question
in database terminology, a set of entity instances refers to what?
answer
table
question
the kind of info stored in a field in a database is what?
answer
data type
question
a project operation does what?
answer
a)return a table with as many rows as the original tables b)return only unique rows and merge duplicate rows c)automatically sort the list in alphabetical order by the first field
question
databases store data just once why?
answer
to avoid redundancy
question
how do you identify the type of data in xml?
answer
by its tag
question
what tag encloses everything in an xml?
answer
the root element
question
when is indenting required in xml?
answer
never
question
a database row is what?
answer
tuple or record
question
database rows are what?
answer
unordered
question
what is the main use of a database?
answer
find info
question
when using a select operation the test is applied to what?
answer
each row
question
the tag is what?
answer
a collection tag
question
the tag is what?
answer
an identification tag
question
what is the root tag?
answer
collection tag
question
what styles xml files for a browser?
answer
xsl
question
an incremental approach to development has the advantage of what?
answer
shortening development time making the final product smaller limiting errors to recently developed materials
question
when you open an xml file without a stylesheet what happens?
answer
it displays a tree showing the structure of your file
question
what are xsl tag rules called?
answer
templates
question
the second line of an xml file that uses an xsl template begins with what?
answer
;?xsl-stylesheet
question
iDiary is ordered by what?
answer
date
question
each attribute in an xsl file requires what?
answer
tag
question
to add entries to idiary you would do what?
answer
modify the xml file
question
xml and xsl files are combined in what to convert them to html?
answer
transformer
question
Virus protection software:
answer
should be installed on your computer immediately must be updated to keep it current must be operating at all times to protect against worms and viruses
question
European privacy standards are closest to the policy called what?
answer
no uses
question
American privacy standards are closest to what?
answer
no limits
question
The accuracy of personal info is who's responsibility?
answer
individual
question
Who is in charge of privacy policies and communication with individuals regarding their privacy?
answer
data controller
question
personal info can be tracked by what?
answer
cell phone use, cookies, ip address
question
if you disable cookies on your computer what happens?
answer
all cookies, including third-party cookies, will be blocked normal Web interaction will be more difficult you won't be able to do online transactions
question
Spyware is what?
answer
software that snoops private info
question
The RSA public key cryptosystem relies on what?
answer
prime numbers
question
where are cookies stored?
answer
on a client and retrieved by a server
question
Backups on you personal computer:
answer
are just as essential to a personal system as a business system
question
personal backups are not critical for what?
answer
information that has been backed up but not changed software programs unimportant files
question
The most important consideration in a disaster recovery plan is what?
answer
to have a backup of your data
question
What puts you at greater risk of being hacked?
answer
using a Web site that doesn't use encryption using email to respond to requests for personal information clicking on a URL instead of typing it in all of the above
question
when were OCED privacy principles developed?
answer
1980
question
Which OCED principle states that personal data should be protected by reasonable security measures against risks of disclosure, unauthorized access, misuse, modification, destruction, or loss?
answer
security Principal
question
Which privacy law was passed in 1996?
answer
Health Insurance Privacy and Accountability Act
question
A cookie contains info stored in how many fields?
answer
seven fields
question
The crime of posing as someone else for fraudulent purposes is known as what?
answer
identity theft
question
A combo of encryption and decryption methods is what?
answer
crytosystem
question
what is the mode in which a virus worm or other malware gets into your computer?
answer
vector of attack
question
What may result from malware?
answer
spam sent from your computer secure information obtained from your computer contents erased on the hard drive
question
When the send button is clicked what happens?
answer
two copies of the message are produced