Here are the solutions to the early evaluation exam. Discussion follows. 

1. False. 

A method may have zero, one or more return statements. 

Maybe we should give some examples here: 

class One {
  public static void main(String[] args) { // this method, main, has zero return statements
    for (int i = 0; i < 10; i++) {
      System.out.println( One.randomValue( 100, 30 ); // prints random int in [30, 130)
    }   
    System.out.println( One.contains("aeiouAEIOU", "watermelon".substring( 2, 3)) ); // checks if 3rd letter in "watermelon" is a vowel or not
  }
  public static void randomValue(int range, int offset) { // this method has one return statement 
    return Math.random( (int) (Math.random() * range + offset) ); // the returned value is one of many (range)
  } 
  public static boolean contains(String one, String letter) { // this method has two return statements 
    for (int i = 0; i < one.length(); i++) 
      if (one.substring(i, i+1).equals( letter )) {
        return true; 
      }
    } 
    return false; 
  }   
}

2. False, see above. 

3. False.

On page 203 of your textbook the term "return value" is defined. 

It doesn't mean "return type". A method has only one return type. 

But as is shown in the answer to the first question a method can return two or more values. 

In fact the simplest justification to this question is: no return type has cardinality one. 

void has cardinality zero, boolean has cardinality two and everything else is by and large infinite. 

4. False. 

A return is not necessary if the return type is void, but if it occurs (with no argument) it ends the method. 

If used that way it reminds the use of break in loops, only in a more generalized way, at the method level. 

Maybe I should give an example from your book: 


7-10.

-bash-4.1$ cat Seven.java
class Seven {

  public static double f(double x) { return g(x) + Math.sqrt(h(x)); }
  public static double g(double x) { return 4 * h(x); }
  public static double h(double x) { return x * x + k(x) - 1; }
  public static double k(double x) { return 2 * (x + 1); }

  public static void main(String[] args) {
    double x1 = f(2);
    System.out.println( x1 );
    double x2 = g(h(2));
    System.out.println( x2 );
    double x3 = k(g(2) + h(2));
    System.out.println( x3 );
    double x4 = f(0) + f(1) + f(2);
    System.out.println( x4 );
  }
}
-bash-4.1$ javac Seven.java
-bash-4.1$ java Seven
39.0
400.0
92.0
62.0
-bash-4.1$