CPBDriver

CPBDriver - public class CPBDriver { public static void...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class CPBDriver { public static void main(String[] args) { CellPhoneBook book; CellPhoneBookEntry entry; int choice, size; String name, cellnum; boolean success; System.out.print("Enter the maximum size of the cell phone book: "); size = IO.readInt(); System.out.print("\nCreating a CellPhoneBook object. .."); book = new CellPhoneBook(size); System.out.println("done."); while (true) { System.out.println("\nCellPhoneBook object reports:"); System.out.print("\ngetSize() -> "); size = book.getSize(); System.out.println(size); for (int i = 0 ; i < size ; i++) { entry = book.getEntry(i); System.out.print("getEntry(" + i + ") -> "); entry.print(); } System.out.println("\nTest menu:\n"); System.out.println("1. Add entry"); System.out.println("2. Lookup cellphone number"); System.out.println("3. Change cellphone number"); System.out.println("4. Sort entries"); System.out.println("5. Quit"); do { System.out.print("\nEnter your choice: "); choice = IO.readInt(); } while (choice < 1 || choice > 5);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

CPBDriver - public class CPBDriver { public static void...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online