Module 7 Quiz Flashcards

1
Q
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…";
}

5, none, 6, or 4?

A

5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following tags enables an HTML programmer to create a loop?

A

HTML doesn’t have a looping function or tag.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Perl and C are the most widely used programming languages among security professionals. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A missing parenthesis or brace might cause a C compiler to return which of the following?

A

Syntax error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following is the Win32 API function for verifying the file system on a Windows computer?

A

FsType()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following C statements has the highest risk of creating an infinite loop?

A

for (;;)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following HTML tags is used to create a hyperlink to a remote Web site?

A

<a></a>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

HTML files must be compiled before users can see the resulting Web pages. True or False?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A C program must contain which of the following?

A

A main() function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

To add comments to a Perl script, you use which of the following symbols?

A

#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

An algorithm is defined as which of the following?

A

A set of instructions for solving a specific problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Before writing a program, many programmers outline it first by using which of the following?

A

Pseudocode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In object-oriented programming, classes are defined as the structures that hold data and functions. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
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

“I made a mistake!”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In C, which looping function performs an action first and then tests to see whether the action should continue to occur?

A

do loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following is the act of performing a task over and over?

A

Looping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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?

A

include

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The print command for Perl is almost identical to the print command used in which of the following programming languages?

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Security professionals often need to examine Web pages and recognize when something looks suspicious. True or False

20
Q

Carelessly reviewing your program’s code might result in having which of the following in your program code?

21
Q

In the C programming language, which variable type holds the value of a single letter?

22
Q

Which of the following special characters is used with the printf() function in the C programming language to indicate a new line?

23
Q

In HTML, each tag has a matching closing tag that is written with which of the following characters?

A

Forward slash /

24
Q

You must always add “//” at the end of comment text when using C language. True or False

25
Which of the following logical operators in the C programming language is evaluated as true if both sides of the operator are true?
&&
26
Which of the following mathematical operators in the C programming language increments the unary value by 1?
++
27
In a 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
28
UNIX was first written in assembly language. However, it was soon rewritten in what programming language?
C
29
In the C programming language, which of the following show where a block of code begins and ends?
Braces {
30
In the C programming language, which statement tells the compiler to keep doing what is in the brackets over and over and over?
for(;;)
31
If you want to know what the Perl print command does, you can use which of the following commands?
perldoc -f print
32
In object-oriented programming, a function contained in a class is called which of the following?
member function
33
Which of the following takes you from one area of a program (a function) to another area?
Branching
34
Which of the following is a markup language rather than a programming language?
HTML
35
Which of the following logical operators in the C programming language is used to compare the equality of two variables?
==
36
You can use the syntax /* and */ to accomplish what function when working with large portions of text?
comment
37
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 it's behind a firewall?
reverse shell
38
In the Perl programming language, which of the following keywords is used in front of function names?
sub
39
Which of the following is a mini-program within a main program that carries out a task?
function
40
Bugs are worse than syntax errors because a program can run successfully with a bug, but the output might be incorrect or inconsistent. True or False
True
41
Most programming languages have a way to branch, loop, and test.
True
42
In object-oriented programming, which of the following are structures that hold pieces of data and functions?
classes
43
In the Perl programming language, variables begin with which of the following characters?
$
44
In the Perl programming language, comment lines begin with the which of the following character(s)?
#
45
When a compiler finds errors, it usually indicates what they are so you can correct the code and compile the program again. True or False
True