quiz 7 Flashcards
A ____ is a mini program within a main program that carries out a task.
function
A loop usually completes after ____________________ is conducted on a variable and returns a value of true or false.
testing
C programs must contain a(n) ____________________ function, but you can also add your own functions to a C program.
main()
main
HTML doesn’t use branching, looping, or testing.
True
The for loop is one of C’s most interesting pieces of code. In the following for loop, the first part initializes the counter variable to 1, and then the second part tests a condition. It continues looping until the value of counter is equal to or less than 10. The last part of the for loop increments the counter variable by 1.
for (counter = 1;counter
In a Perl program, to go from one function to another, you simply call the function by entering the function name in your source code. In the following example, the &name_best_guitarist line branches the program to the sub name_best_guitarist function:
# Perl program illustrating the branching function # Documentation is important # Initialize variables $first_name = "Jimi"; $last_name = "Hendrix"; &name_best_guitarist; sub name_best_guitarist { printf "%s %s %s", $first_name, $last_name, "was the best!"; }
If you want to know what the Perl print command does, you can use ____.
perldoc -f print
In C, the statement ____ tells the compiler to keep doing what’s in the brackets over and over and over.
for(;;)
In Perl, variables begin with the ____ character.
$
In Perl, the keyword “____” is used in front of function names.
sub
In Perl, comment lines begin with the ____ character(s).
#
In programming, what are variables used for?
A variable represents a numeric or string value.For example, you can solve x + y = z if you know two of the variable values. In programming, you can declare variables at the beginning of a program so that calculations can be carried out without user intervention. A variable might be defined as a character or characters, such as the letters of the alphabet, or it can be assigned a numeric value, as in the expression int x = 1.
List and describe the variable types used in C.
int: Use this variable type for an integer (positive or negative number).
float: This variable type is for a real number that includes a decimal point, such as 1.299999.
double: Use this variable type for a double-precision floating point.
char: This variable type holds the value of a single letter.
string: This variable type holds the value of multiple characters or words.
const: A constant variable is one you create to hold a value that doesn’t change for the duration of your program. For example, you can create a constant variable called TAX and give it a specific value: const TAX - .085. If this variable is used in areas of the program that calculate total costs after adding an 8.5% tax, it’s easier to change the constant value to a different number if the tax rate changes, instead of changing every occurrence of 8.5% to 8.6%.
Many scripts and programs for security professionals are written in ________________________________________, a powerful scripting language
Practical Extraction and Report Language
PERL
Practical Extraction and Report Language (PERL)
PERL (Practical Extraction and Report Language)
Most programming languages do not have a way to conduct testing of a variable.
False
Mention three C compilers and on which operating systems they are available.
Intel Compilers for Windows and Linux: Intel’s C++ compiler for developing applications for Windows servers, desktops, and handheld PDAs. The Intel Linux C++ compiler claims to optimize the speed of accessing information from a MySQL database, an open-source database program used by many corporations and e-commerce companies.
Microsoft Visual C++ Compiler: This compiler is widely used by programmers developing C and C++ applications for Windows platforms.
GNU C and C++ compilers (GCC): These free compilers can be downloaded for Windows and *nix platforms. Most *nix systems include the GNU GCC compiler.
Security professionals often need to examine Web pages and recognize when something looks suspicious.
True
Software engineering firms don’t retain computer programmers who do not document their work because they know that 80% of the cost of software projects is ____.
maintenance