Search:

Type: Posts; User: paco

Search: Search took 0.31 seconds.

  1. Re: Keeping track of found objects in array and smallest value

    Im aware of that but am I just trying to make it fool proof, as in what if there happens to be 7 or n + 1 matches then it has to be an array of 7 elements, and since my array is one of the first...
  2. Re: Keeping track of found objects in array and smallest value

    I have set my original 2 arrays to 10, so now if I make a third array to copy my 2nd array to, then there will be some slots that will be filled with 0's and those will get copied over. I guess I...
  3. Re: Keeping track of found objects in array and smallest value

    I dont know what array list is, havent learned that yet, also if I were to move it to another array, say ar1 = ar2 wouldn't they just be the same size and the same outcome would happen?
  4. Re: Keeping track of found objects in array and smallest value

    ok I will try now, thanks, thought there might have been another way/method
  5. Re: Keeping track of found objects in array and smallest value

    Yes I am trying to change the size of the ray and make it equal to my count which would have been the amount of times where my title and ISBN are the same. That way only the ones that are found will...
  6. Re: Keeping track of found objects in array and smallest value

    By looking at my code is that what you recommend I should do?
  7. Re: Keeping track of found objects in array and smallest value

    yea got that part :D took some time though, i am very slow.

    update: i still am stuck at this, my problem is valueFound[i] = k; . I dont know how to get around this, I can't declare my second...
  8. Re: Keeping track of found objects in array and smallest value

    reversed those 2 and my first part is working again.



    valueFound[i] = k;


    but now output:
  9. Re: Keeping track of found objects in array and smallest value

    I just ran it and got:

    Please enter a book title:
    ho
    Please enter a ISBN number:
    1001
    The book title is ho, the ISBN number is 1001 and the price is 70.0$.

    Index Information At Index...
  10. Re: Keeping track of found objects in array and smallest value

    "set smallest value variable to the first element in the list
    begin loop starting at the second element in the list"

    whats wrong with the way I have it above? If I am checking all the values of...
  11. Re: Keeping track of found objects in array and smallest value

    the first for loop goes through my list checking for books with the same price and ISBN # and then stores where they are located in that array, into a separate array (i want to change the price...
  12. Re: Keeping track of found objects in array and smallest value

    thanks for stating the obvious, I was hoping for an example, but I guess you think I am being lazy and want you to spit out the answer...WRONG! I am deeply confused and need help, heres my attempt,...
  13. Re: Keeping track of found objects in array and smallest value

    how do I keep track of the values stored and then find the smallest of those values using my above code and my other class (down below), is the question.



    class Book {
    //Attributes of Book
    ...
  14. Re: Keeping track of found objects in array and smallest value

    I have to keep my array like this in my book class:
    update:


    import java.util.Random;
    import java.util.Scanner;
    public class ModifyBooks {

    public static void main(String[] args) {
  15. Keeping track of found objects in array and smallest value

    Hello I am trying to devise some code to store the index values of where I have found a book title and key code (which will be ISBN) in an array, I am stuck at here



    for (int k = 0; k <...
  16. Replies
    10
    Views
    202

    Re: How to search through values of Array?

    can you please explain this piece of code to me and the use for it? I am trying to understand it why the scanner is being used and what bookData is doing. thanks



    // Create 10 books with the...
  17. Replies
    10
    Views
    202

    Re: How to search through values of Array?

    hi greg before I just saw your code I got something similar to yours, but it excludes making a method and it turns out it is not working, but the part of code that I got is pretty much identical to...
  18. Replies
    10
    Views
    202

    Re: How to search through values of Array?

    Hey thanks for your help and patience, but unfortunately I still do not understand what you doing. It seems like your first piece of code is trying to just go through the book list and display the...
  19. Replies
    10
    Views
    202

    Re: How to search through values of Array?

    Ok I dont understand how you can use the for loop to store the data for each book. If I use a loop won't they all be named the same and have the same parameters, if there is a way to avoid this I...
  20. Replies
    10
    Views
    202

    Re: How to search through values of Array?

    Hi there greg, I can't use the for loop because I have to declare my 10 books to be uniquely different from another ( i simply just put hi for the values of name for now), essentially 10 different...
  21. Replies
    10
    Views
    202

    How to search through values of Array?

    Hello everyone, I am java noob so please bear with me, I have two classes for a program thats supposed to search for books but I am currently stuck!. Where I am stuck is at the bottom of the...
Results 1 to 21 of 21