Search:

Type: Posts; User: clarky2006

Page 1 of 3 1 2 3

Search: Search took 0.07 seconds.

  1. Re: Creating Random unused ID number for every library member.

    Hi Norm..Just seen my tutor and hes saying that my comparison is wrong on the print carByRegistration method.
    He says I should use the compareto method instead. Never used compare to before.
    can...
  2. Re: Creating Random unused ID number for every library member.

    ok..I will use the equals() method then so they have to enter the full registration for the right car to be removed instead of searchstring as searchstring would throw up the wrong cars...Thank you...
  3. Re: Creating Random unused ID number for every library member.

    I cant really understand that last reply..What is "AS" and "ASDF"? as you know I'm new to java...

    --- Update ---


    import java.util.ArrayList;
    import java.util.Iterator;
    import...
  4. Re: Creating Random unused ID number for every library member.

    They want to be able to remove a car that is sold from the Stock Class by just entering the registration number...
  5. Re: Creating Random unused ID number for every library member.

    Here is the alternative method im thinkinking of using but not sure...


    public void removeCarByRegistration(String searchString)
    {
    Iterator<Car> it = cars.iterator();
    ...
  6. Re: Creating Random unused ID number for every library member.

    But can I use the equals method when the return type is string?
  7. Re: Creating Random unused ID number for every library member.

    Morning Norm..Not sure wot time it is across the pond..Hey got more issues with java methods
    Have a look at this code please. I created this for a car dealership. here im trying to remove a car by ...
  8. Re: Creating Random unused ID number for every library member.

    Just got my results yesterday mate...Got an A 80% all thanks to you...Cheers for all the help and support.....
  9. Re: Creating Random unused ID number for every library member.

    The last post was a second constructor. I dont know how to use the add method..

    --- Update ---

    The second constructor keeps highlighting new GregorianCalendar as an incompatible type..
  10. Re: Creating Random unused ID number for every library member.

    This is a second constructor, it wont compile so i had to comment out sum of the code..


    /**
    * Constructor for objects of class Loan
    */
    public Loan(int bookId, int memberId)...
  11. Re: Creating Random unused ID number for every library member.

    d = d + 21;
    if (d > 30)
    {
    d= 1;
    m = m + 1;
    }
    if (m > 12)
    {
    m = 1;
    y = y + 1;
  12. Re: Creating Random unused ID number for every library member.

    it does compile in blue J..u dont need main method in blue J..i ve just compiled it again and it says no syntax errors..

    --- Update ---


    import java.util.*;
    import java.text.*;

    /**
    *...
  13. Re: Creating Random unused ID number for every library member.

    public String loanDate(int bookID)
    {
    String dateborrowed = "";
    for(Loan loan : loans)
    {
    if(loan.getBookId() == bookId)
    {
    dateborrowed =...
  14. Re: Creating Random unused ID number for every library member.

    public String DateLoanIsDueBack(int bookId)
    {
    for(Loan loan : loans)
    {
    String dateReturned = "";
    if(loan.getBookId() == bookId)
    {
    ...
  15. Re: Creating Random unused ID number for every library member.

    Just read the API documentation and still not sure how to call this method..Im running out of time to finish this work..I do know that non-static means that its not there. does not exist yet.

    ---...
  16. Re: Creating Random unused ID number for every library member.

    public String dateBookdueback(int bookID)
    {
    Loan.getLoanDate();
    }

    My library is nearly done now....thanks to you......Got some issues here the above code, trying to call the...
  17. Re: Creating Random unused ID number for every library member.

    What type is loanDate?

    its gregorian calendar
  18. Re: Creating Random unused ID number for every library member.

    /**
    *
    *
    */
    public void printLoanDetails()
    {
    System.out.println("Member ID:" + memberId);
    System.out.println("Book ID:" + bookId);
    DateFormat...
  19. Re: Creating Random unused ID number for every library member.

    You are right, Wish I knew that yesterday..wud have saved me so much time...to do my documentation..

    --- Update ---

    more issues tho...when I print, it prints the book ID and member ID ok but...
  20. Re: Creating Random unused ID number for every library member.

    Did you read my last post? You can't code anything that comes into your head. You must follow the rules as defined in the API.

    The variable: Date does NOT exist in the GregorianCalendar class.
    ...
  21. Re: Creating Random unused ID number for every library member.

    trust me if i understood how to do it, then i would have by now...the API is so hard to understand it causes me more confusion than it solves. i could look at it all day and still not understand it...
  22. Re: Creating Random unused ID number for every library member.

    dateLoanDueBack.Date..........The dateLoanDueBack value should be 3 weeks from when the object is created(21 days)
  23. Re: Creating Random unused ID number for every library member.

    Or can you please help me add 21 days to the loanDate as im struggling to do it..been trying for nearly 2 wks now. At least i would know how to do it next time..Have till Friday to submit this..Its a...
  24. Re: Creating Random unused ID number for every library member.

    /**
    * Constructor for objects of class Loan
    */
    public Loan(int bookId, int memberId)
    {
    // initialised fields.
    this.bookId = bookId;
    this.memberId =...
  25. Re: Creating Random unused ID number for every library member.

    import java.util.GregorianCalendar;
    import java.util.Calendar;
    import java.util.*;
    import java.util.*;
    /**
    * This Class would hold all loan details.
    *
    * @author ()
    * @version 1.0
    */
Results 1 to 25 of 51
Page 1 of 3 1 2 3