Quiz 6

Wednesday

With a piece of paper, write down your name and answers to the following questions.

  1. What is the name of the character that separates tokens in a string?

    1. Separator
    2. Tokenizer
    3. Delimiter
    4. Terminator
  2. The startsWith and endsWith methods are members of which class?

    1. Char
    2. Character
    3. StringBuilder
    4. String
  3. Which StringTokenizer method returns true if there are more tokens to be extracted from a string?

    1. moreTokens
    2. tokensLeft
    3. getToken
    4. hasMoreTokens
  4. Is the following statement correct, and why?

    Character testing methods in the Character class, such as isLetter, accept strings as arguments and test each character in the string.

    Answer: False, character testing methods in the Character class, such as isLetter, accept char type data as arguments

  5. Find and correct the error in the following program.

    public class Program {
      public static void main(final String[] args) {
        StringBuilder builder = "CSCI 2912";
        builder.append("Hawaii Pacific University");
      }
    }

    Correction:

    public class Program {
      public static void main(final String[] args) {
        StringBuilder builder = new StringBuilder("CSCI 2912");
        builder.append("Hawaii Pacific University");
      }
    }

    Or:

    public class Program {
      public static void main(final String[] args) {
        StringBuilder builder = new StringBuilder();
        builder.append("CSCI 2912");
        builder.append("Hawaii Pacific University");
      }
    }

Student Performance and Statistics

A histogram of student performance on percentage grades for Quiz 6 on Wednesday.

100% 4 90 - 99% 2 80 - 89% 4 70 - 79% 0 60 - 69% 2 50 - 59% 2 40 - 49% 1 30 - 39% 0 20 - 29% 1 10 - 19% 0 0 - 9% 0

A table showing the average performance for each question in Quiz 6 on Wednesday.

Q1 0.7 / 1 Q2 0.6 / 1 Q3 0.9 / 1 Q4 0.8 / 1 Q5 0.8 / 1