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

A

True

20
Q

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

A

Bug

21
Q

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

A

Char

22
Q

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

A

\n

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

A

False

25
Q

Which of the following logical operators in the C programming language is evaluated as true if both sides of the operator are true?

A

&&

26
Q

Which of the following mathematical operators in the C programming language increments the unary value by 1?

A

++

27
Q

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?

A

name

28
Q

UNIX was first written in assembly language. However, it was soon rewritten in what programming language?

A

C

29
Q

In the C programming language, which of the following show where a block of code begins and ends?

A

Braces {

30
Q

In the C programming language, which statement tells the compiler to keep doing what is in the brackets over and over and over?

A

for(;;)

31
Q

If you want to know what the Perl print command does, you can use which of the following commands?

A

perldoc -f print

32
Q

In object-oriented programming, a function contained in a class is called which of the following?

A

member function

33
Q

Which of the following takes you from one area of a program (a function) to another area?

A

Branching

34
Q

Which of the following is a markup language rather than a programming language?

A

HTML

35
Q

Which of the following logical operators in the C programming language is used to compare the equality of two variables?

A

==

36
Q

You can use the syntax /* and */ to accomplish what function when working with large portions of text?

A

comment

37
Q

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?

A

reverse shell

38
Q

In the Perl programming language, which of the following keywords is used in front of function names?

A

sub

39
Q

Which of the following is a mini-program within a main program that carries out a task?

A

function

40
Q

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

A

True

41
Q

Most programming languages have a way to branch, loop, and test.

A

True

42
Q

In object-oriented programming, which of the following are structures that hold pieces of data and functions?

A

classes

43
Q

In the Perl programming language, variables begin with which of the following characters?

A

$

44
Q

In the Perl programming language, comment lines begin with the which of the following character(s)?

A

#

45
Q

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

A

True