Hands-On Ethical Hacking And Network Defense
In the Perl programming language, which of the following keywords is used in front of function names?
sub
Writing programs in this language is easier than in machine language.
Assembly language
Which of the following takes you from one area of a program (a function) to another area?
Branching
Which of the following is a mini-program within a main program that carries our a task?
Function
Which of the following is a markup language rather than a programming language?
HTML
Documentation of a program should include which of the following? (Choose all that apply.) a. author b. date written c. explanation of complex algorithms. d. modifications to the code
a. author b. date written c. explanation of complex algorithms. d. modifications to the code
Before writing a program, many programmers outline it first by using which of the following? a. pseudocode b. machine code c. assembly code d. assembler code
a. pseudocode
A C program must contain which of the following? a. name of the computer programmer b. a main ( ) function c. The #include <std.h> header file d. a description of the algorithm used
b. a main ( ) function
A way of having your program repeat an action a certain number of times.
while loop
Which of the following statements in the C programming language is used to load libraries that hold the commands and functions used in your program?
# include
In the Perl programming language, variables begin with which of the following characters?
$
Which of the following mathematical operators in the C programming language increments the unary value by 1?
++
Which of the following logical operators in the C programming language is used to compare the equality of two variables?
==
In the C programming language, which of the following show were a block of code begins and ends?
Braces
Takes you from one area of a program (a function) to another area.
Branching
Carelessly reviewing your program's code might result in having which of the following in your program code?
Bug
The print command for Perl is almost identical to the print command used in which of the following programming languages?
C
In the C programming language, which variable type holds the value of a single letter?
Char
You can use the syntax /* and */ to accomplish what function when working with large portions of text?
Comment
HTML files must be compiled before users can see the resulting Web pages. True of False?
False
In the Perl program, to go from one function to another, you simply call the function by entering which of the following in your source code?
Name
An English-like language you can use to help create the structure of your program.
Psuedo code
In object-oriented programming, classes are defined as the structures that hold data and functions. (T/F)
True
Most programming languages have a way to branch, loop, and test. (T/F)
True
Perl and C are the most widely used programming languages among security professionals. T/F
True
When a compiler finds errors, it usually indicates what they are so you can correct the code and compile the program again. (T/F)
True
Most programming languages enable programmers to perform which of the following actions? (choose all that apply) a. branching b. testing c. faulting d. looping
a. branching b. testing d. looping
What are the three looping mechanisms in C? (choose all that apply) a. for loop b. while loop c. if-then-else loop d. do loop
a. for loop b. while loop d. do loop
What is the result of running the following C program? main () { int a = 2; if (a = 1) printf ("I made a mistake!") ; else printf ("I did it correctly!") ; } a. "Syntax error: illegal use of ;" is displayed b. "I made a mistake!" is displayed c. "Syntax error: variable not declared" is displayed d. "I did it correctly!" is displayed
b. "I made a mistake!" is displayed
Which of the following HTML tags is used to create a hyperlink to a remote Web site? a. <A HREF=http://URL> b. <A HREF="http://URL"> c. <A HREF="file:///c:/filename> d. <A HREF/>
b. <A HREF="http://URL">
To add comments to a Perl script, you use which of the following symbols? a. / / b. / * c. # d. < ! --
c. #
Which of the following is the Win32 API function for verifying the file system on a Windows computer? a. Filesystem ( ) b. FsType ( ) c. System ( ) d. IsNT ( )
c. FsType ( )
In C, which looping function performs an action first and then tests to see whether the action should continue to occur? a. for loop b. while loop c. do loop d. unless loop
c. do loop
Program that converts a text-based program called source code, into executable or binary code.
compiler
In the C programming language, which statement tells the compiler to keep doing what is in the brackets over and over and over?
for (; ;)
In object-oriented programming, a function contained in a class is called which of the following?
member function
If you want to know what the Perl print command does, you can use which of the following commands?
perldoc -f print
An error that causes unpredictable results.
Bug
You must always add "//" at the end of comment text when using C language. (T/F)
False
Which of the following tags enables an HTML programmer to create a loop? a. <LOOP> b. <NEST> c. <WHILE> d. HTML doesn't have a looping function or tag
d. HTML doesn't have a looping function or tag
Performs an action first and then tests to see whether the action should continue to occur.
Do Loop
Which of the following is the act of performing a task over and over?
Looping
Represents a numeric or string value.
Variable
Which of the following special characters is used with the printf() function in the C programming language to indicate a new line?
\n
A missing parenthesis or brace might cause a C compiler to return which of the following? a. system fault b. interpreter error c. syntax error d. machine-language fault
c. syntax error
Using the following Perl code, how many times will "This is easy..." be displayed onscreen? for ($count=1; $count <= 5; $count++) { print "This is easy..."; } a. 6 b. 4 c. none (syntax error) d. 5
d. 5
Which of the following C statements has the highest risk of creating an infinite loop? a. while (a > 10 ) b. while (a < 10 ) c. for (a = 1; a < 100; ++a) d. for (; ;)
d. for (; ;)
Security professionals often need to examine Web pages and recognize when something looks suspicious. (T/F)
True
An object-oriented programming structure that holds pieces of data and functions.
class
In the Perl programming language, comment lines begin with which of the following characters(s)?
#
Which of the following logical operators in the C programming language is evaluated as true if both sides of the operator are true?
&&
List three logical operators used in C programming.
AND, OR, NOT
UNIX was first written in assemble language. However, it was soon rewritten in what programming language?
C
Which of the following is a backdoor initiated from inside the target's network that makes it possible to take control of the target even when its behind a firewall?
Reverse Shell
In HTML, each tag has a matching closing tag that is written with which of the following characters?
forward slash (/)
In object-oriented programming, which of the following are structures that hold pieces of data and functions?
classes
Tells the compiler how to convert the value in a function.
Conversion Specifier
Name two looping mechanisms use in Perl.
for loop while loop
Bugs are worse than syntax errors because a program can run successfully with a bug, but the output might be incorrect or inconsistent. (T/F)
True
An Algorithm is defined as which of the following? a. a list of possible solutions for solving a problem b. a method for automating a manual process c. a program written in a high-level language d. a set of instructions for solving a specific problem
d. a set of instructions for solving a specific problem