It's really helpful - almost necessary - to post executable code or error messages when you want help with code that "doesn't work." For example, here's runnable code using your own code that shows...
Type: Posts; User: GregBrannon
It's really helpful - almost necessary - to post executable code or error messages when you want help with code that "doesn't work." For example, here's runnable code using your own code that shows...
Your question:
Focusing on your question, the desired method would look something like:
private boolean[] findBookMatches( Book[] books, String title, double price )
{
// create a...
Using a for loop to create the 10 books. Here's one way:
import java.util.Scanner;
public class BookSearch
{
//Create 10 book objects with values
private static String[] bookData...
Of course you can do that using a for loop (or some kind of loop). You just need to be a bit more clever. Store the data that defines each book and apply it to an appropriate constructor to create...
Your construction of the array that contains Book objects can be improved:
Book[] books = new Book[10];
Then to populate the array with Book objects, use a for loop:
for ( int i = 0 ; i <...