Hands-On Ethical Hacking and Network Defense, 3e, ISBN 9781285454610
Ch. 7 Solutions-1
Chapter 7 Solutions
Review Questions
1. A C program must contain which of the following?
2. An algorithm is defined as which of the following?
3. A missing parenthesis or brace might cause a C compiler to return which of the
following?
4. List three logical operators used in C programming.
AND, OR, and NOT
5. Most programming languages enable programmers to perform which of the following
actions? (Choose all that apply.)
6. Before writing a program, many programmers outline it first by using which of the
following?
7. Which of the following C statements has the highest risk of creating an infinite loop?
8. To add comments to a Perl script, you use which of the following symbols?
9. Documentation of a program should include which of the following? (Choose all that
apply.)
10. Name two looping mechanisms used in Perl.
11. In C, which looping function performs an action first and then tests to see whether the
action should continue to occur?
12. What is the result of running the following C program?
Hands-On Ethical Hacking and Network Defense, 3e, ISBN 9781285454610
Ch. 7 Solutions-2
13. Using the following Perl code, how many times will “This is easy…” be displayed
onscreen?
14. HTML files must be compiled before users can see the resulting Web pages. True or
False?
15. Which of the following HTML tags is used to create a hyperlink to a remote Web site?
16. In object-oriented programming, classes are defined as the structures that hold data and
functions. True or False?
17. What are the three looping mechanisms in C? (Choose all that apply.)
18. Which of the following is the Win32 API function for verifying the file system on a
Windows computer?
19. Perl and C are the most widely used programming languages among security
professionals. True or False?
20. Which of the following tags enables an HTML programmer to create a loop?
Activities
Activity 7-1
Answers will vary. The algorithm might include the following steps:
1. Get a bowl.
3. Get a fork.
5. Crack the eggs into the bowl.
7. Use the fork to stir the eggs vigorously until the mixture is yellow.
If a student forgets to remove the shells, he or she has missed an important step in creating the
algorithm.
Activity 7-6
Hands-On Ethical Hacking and Network Defense, 3e, ISBN 9781285454610
Ch. 7 Solutions-3
Step 18: Answers will vary. Students might think of formatting the output so that descriptions of
the information gathered are easy to recognize. For example, instead of just listing “NTFS,” the
program could display “The file system of this computer is NTFS.”
Step 20: Answers will vary. Students should think outside the box, not just look at what’s
available in the table of Win32 API functions. For example, is it possible to get the IP
configuration from the computer? Could a script be written to display the IP address, MAC
address, and default gateway configured for each computer?
Case Projects
Case Project 7-1: Determining Software Engineering Risks for Alexander
Rocco
Case Project 7-2: Developing a Security-Testing Tool
Answers will vary. The memo should mention the programming language the student chose (C or