Page 1 of 1

Create these methods

Posted: Sun Jul 03, 2022 11:59 am
by answerhappygod
Create these methods
Create These Methods 1
Create These Methods 1 (51.4 KiB) Viewed 19 times
Method Summary All Methods Static Methods Concrete Methods Modifier and Type Method static Book [] addBook (Book [] array, Book aBook) static Book static Book [] static int static void static java.lang.String private static java.lang.String createBook (java.util.Scanner kb) fillArray (java.util.Scanner fin, int total) menu (java.util.Scanner kb) printBooks (Book [] array, java.io.PrintStream output) readOutputFilename (java.util.Scanner kb) readstring(java.lang.String type, java.util.Scanner kb) Description The addBook method makes a new array of the old size plus one Next it copies the books from the old array to the new array Next it adds the new book in last index of the new array The createBook method prompts the user to enter title, isbn, pages, and author. The fillArray method first creates an array of books, and then fills each index of the book array with a new Book object. The menu method offers the user a choice from: 1) Print the books to the screen 2) Print the books to a file 3) Sort the books based on natural order 4) Sort the books based on total order 5) Add a new book to the bookshelf 6) Search the bookshelf for a book 7) Quit The printBooks calls the toString method of book and prints each book out followed by a CR The readOutput Filename calls the readString to read a output filename The readString reads a string from the keyboard and ensures the string is not null or empty