Lab: Ch 4 Notebook

Preparation

Do the following before arriving at lab:

  • Read chapter 4.1 - 4.8
  • Bring your textbook to lab

Objectives

After completing this lab, you should be able to:

  • access data from an ArrayList
  • use repetition statements to solve problems

Exercises

Perform each of the following exercises.

  1. Open the Notebook1 project in Chapter 4
  2. Add your name as author
  3. Exercise 4.1
  4. Exercise 4.9 (enter/type removeNote() )
  5. Exercise 4.12 (type listNotes() )
  6. Exercise 4.13
  7. write a method called boolean isValidIndex(int index) that is passed an integer representing a potential index into the ArrayList. Return true if the index is valid, otherwise return false.
  8. modify showNote and removeNote to use the isValidIndex method written in the previous exercise to test whether the index is not valid.
  9. Exercise 4.20 (write search() )
  10. Exercise 4.21 (modify listNotes() )
  11. Exercise 4.22
  12. Print the source code (with your name).

Grading Criteria

This lab is worth a possible 10 points.

  • methods (8 pts)
  • coding style (2 pts)