Answer the following questions true (T) or false (F)

1. Consider two blocks, one within another. C++ prohibits an identifier to be declared as a variable in each of these blocks.

2. Calling something a black box is a figure of speech that conveys the idea that you cannot see inside. You know its behavior and interface but not its implementation.


1. False
Explanation: Without the inner variable, the scope of the outer variable would be the entire outer block, including the inner block. The variable with the inner block for its scope shadows the outer variable’s scope, making a hole in the scope of the outer variable.
2. True
Explanation: If a function is well designed, a client programmer can use it without knowing the internals. All the programmer needs to know is that if the preconditions on the arguments are met, all he or she has to do is to name the function and enter the arguments. The black box will take care of everything else.

Computer Science & Information Technology

You might also like to view...

A slide ________ in PowerPoint includes an arrangement of placeholders

Fill in the blank(s) with correct word

Computer Science & Information Technology

Right-clicking an object causes a menu of context-sensitive commands to display

Indicate whether the statement is true or false

Computer Science & Information Technology

Case Based Critical Thinking Questions

Case 5-2 Marie works for a busy pediatrician's office. The practice has a sophisticated database for all records and information that pertain to the practice. The doctor for whom she works is participating in an academic study, and she needs a report that lists the patient's name, date of birth, and the names of parents or guardians. The doctor would like to see the patient's full name in the format Lastname, Firstname even though they are separate fields in the database. She would also like to see the data for the fields Mother, Father, and Guardian, regardless of whether or not data is actually entered in those fields.  Based on the doctor's requirements for the report, Marie must create a query on which to base the report. ? Marie creates the following expression as a new field in the query that she will use to create the report requested by the doctor PatientName: [LastName] & ", " [FirstName].  This expression is an example of ____. A. IsNull B. concatenation C. nonnull D. an expression using a logical operator

Computer Science & Information Technology

Which of the following tools would be BEST to use to pry open the case of a laptop?

A. Metal screwdriver B. Plastic wedge C. Needle-nose pliers D. Extension magnet

Computer Science & Information Technology