TestBook - book3.author = "Daniel...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; i public class TestBook { public static void main(String[] args) { int MAX_NUMBER_OF_BOOKS = 100; Book[] allBooks = new Book[MAX_NUMBER_OF_BOOKS]; B // Book 1 Book book1 = new Book(); book1.isbn = "0071545883"; book1.title = "Linux Administration"; book1.author = "Wale Soyinka"; book1.price = 39.99; allBooks[0] = book1 ; a // Book 2 Book book2 = new Book(); book2.isbn = "0136012671"; book2.title = "Introduction to Java Programming"; book2.author = "Daniel Liang"; book2.price = 118.00; allBooks[1] = book2 ; // Book 3 Book book3 = new Book(); book3.isbn = "1930110359"; book3.title = "Java 3D Programming";
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: book3.author = "Daniel Selman"; book3.price = 49.95; allBooks [2] = book3; a Scanner keyboard = new Scanner(System.in); int choice = 0 ; i while(choice != 4) { choice = BookUI.getMenuChoice(keyboard); c if (choice == 1) { keyboard.nextLine(); // To Avoid an extra new Line Book book = BookUI.readBook(keyboard); BookUtils.addBook (allBooks, book); } else if (choice == 2) { BookUI.displayBooks(allBooks); } else if (choice == 3) { Book book = BookUtils.getCheapestBook(allBooks); BookUI.displayBook(book); } } } }...
View Full Document

Ask a homework question - tutors are online