IntegerListTest - Provide a...

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

View Full Document Right Arrow Icon
// **************************************************************** // // // Provide a menu-driven tester for the IntegerList class. // // **************************************************************** import java.util.Scanner; public class IntegerListTest{ static IntegerList list = new IntegerList(10); static Scanner scan = new Scanner (; //------------------------------------------------------- // Create a list, then repeatedly print the menu and do what the // user asks until they quit //------------------------------------------------------- public static void main(String[] args) { printMenu(); int choice = scan.nextInt(); while (choice != 0) { dispatch(choice); printMenu(); choice = scan.nextInt(); } } //------------------------------------------------------- // Do what the menu item calls for //------------------------------------------------------- public static void dispatch(int choice) { int loc; int oldVal, newVal; switch(choice) { case 0: System.out.println("Bye!");
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

IntegerListTest - Provide a...

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