This website is preserved for historical and scholarly reference and is no longer actively maintained.
QUIZ 9
September 14, 1998
#1. What is a predicate method?
#2. What is the interface of a class?
#3. Write an expression that is equivalent to the following but contains no ! operators. (Hint: use one of DeMorgan's laws.)
! ( ( a < b ) && ( c != d ) )
#4. One of the methods of class Name, setTitle, assigns the title passed in as a parameter to the instance variable holding the title. If the parameter and instance variable are as given below, write the code to make the assignment from parameter to instance variable.
public void setTitle ( String title ) {
}
private String title; // instance variable
#5. The text says that the all-paths approach is not possible in looping constructs, but at a minimum, there are three cases that should be tested. Identify these three cases.
(1)
(2)
(3)