Quiz 7: Programming for Security Professionals

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

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

$

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

&&

Why is documenting computer programs essential?

Documentation makes a program easier to modify.

Which of the following correctly illustrates a comment in the C language? a. /* This is a comment */ b. ** This is a comment ** c. ## This is a comment ## d. "This is a comment";

a.

In object-oriented programming, a specific instance of a class is known as which of the following?

object

In order to get more information about perl command parameters, what command could be used?

perl -h

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

sub

What formatting character can be used in combination with the printf command in Perl to format a floating-point number in scientific notation?

%e

What is the difference between the = and = = operators in C?

A single = is an assignment operator; == is a comparison operator

What is the relationship between algorithms, pseudocode, and a program?

After an algorithm is created, a programmer would then convert this algorithm into pseudocode. Pseudocode is an English-like language that can be used to help create the structure of a program in the language of your choosing.

What benefit does object-oriented programming offer?

All are benefits of object-oriented programming

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

Branching

Most programming languages include a way to do which of the following?

Branching, Looping, and Testing

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

C

Which language is not considered an object-oriented programming language?

C

There are two philosophies on how to handle syntax errors. Many programmers believe the compiler should check for errors in their code, while others refuse to compile the program until they have examined the code thoroughly and are confident it's accurate and syntactically correct. What is the benefit of the latter?

Examining the code before compiling it increases coding skills.

Which of the following statements about Python functions is false?

Functions that don't expect parameters are called without the parentheses,

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

HTML

Third-party media players on webpages were often problematic and proved to be security risks, but are no longer needed due to which version of HTML?

HTML 5

HTML does not use branching, looping, or testing due to which of the following?

HTML is a markup language, not a programming language.

Which of the following would likely cause a syntax error in Python?

Inconsistent spacing.

Why do many security professionals with C programming experience choose Perl as a scripting language?

Perl's syntax is much like the C syntax except for minor differences.

Which programming language created by Guido van Rossum can run on almost any platform (including Windows) and is usually already installed on *nix-based OSs?

Python

To return the username of the person running Perl, what command is necessary?

Win32::LoginName()

The Win API has the NodeName() function, which returns the NetBIOS computer name. To use this function, a programmer would reference it with what line of code?

Win32::NodeName()

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

braces

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

bug

In object-oriented programming, which term refers to a structure that holds pieces of data and functions?

class

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

forward slash (/)

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

function

If a line in the Perl programming language begins with a #, the line is considered what?

nonexecutable

What programming language emphasizes code readability and uses indentation to define blocks of code?

Python

Why is knowledge of HTML important for a security professional?

HTML isthe basis of web development

Python is a scripting language that is often used for creating small to medium-sized programs quickly. What quality of scripting languages arguably makes them faster when creating and testing short programs?

Scripting languages do not need to be compiled.

Which of the following is a Python syntax rule? a. Comment lines begin with the // symbols. b. Begin variables with the $ symbol. c. Use curly brackets to define blocks of code in if statements and functions. d. Insert the def keyword in front of the function's name when creating a function.

d

A function contained in a class is known as what?

member function

Python has an interactive shell where Python commands can be entered and immediately executed. This shell is also known as what?

REPL


Ensembles d'études connexes

Semester 3: Exam 1: Pharmacology

View Set

NSG 352 exam 2 practice quetsions

View Set

AP European History, Chapter 17.3

View Set

events that occur at a chemical synapse

View Set

Legal Environment of Business Quarter 2

View Set